YelpReviews_Shortcode::shortcode( array $atts, null|string $content = null, string $tag = '' )
YelpReviews shortcode.
Contents
Parameters Parameters
- $atts
-
(array) (Required) attributes
- $content
-
(null|string) (Optional) content
Default value: null
- $tag
-
(string) (Optional) tag
Default value: ''
Return Return
(string)
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();
}
Changelog Changelog
| Version | Description |
|---|---|
| 1.0.0 | Introduced. |