YelpReviews_Shortcode::shortcode( array $atts, null|string $content = null, string $tag = '' )

YelpReviews shortcode.


Parameters Parameters

$atts

(array) (Required) attributes

$content

(null|string) (Optional) content

Default value: null

$tag

(string) (Optional) tag

Default value: ''


Top ↑

Return Return

(string)


Top ↑

Source Source

File: mortgage-yelp-review/inc/YelpReviews_Shortcode.php

	public function shortcode($atts, $content = null, $tag = '') {
		$reviews = new YelpReviews();
		$yelp_review = $reviews->get_reviews($atts);

		ob_start();
		$style = isset($atts['style']) ? $atts['style'] : (isset(get_option('mortgage_yelp_widget')['style']) ? get_option('mortgage_yelp_widget')['style'] : 'list');

		$attr = array('style'=>$style);

		/**
		 * Enqueue mortgage yelp reviews script.
		 * @since 1.0.0
		 */
		do_action('mortgage_yelp_scripts', $attr);

		$this->shortcode_html($yelp_review, $style);
		return ob_get_clean();

	}

Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0 Introduced.