Shortcode in functions.php
-
I am using
echo do_shortcode('[yasr_overall_rating size="medium"]');
to show ratings in a single page, everything works fine.I also need to view the ratings in a googlemap popup (Pronamic plugin).
I am able to output in the popup everything I need from the post except for the ratings.This is the code to customize the popup in my functions.php:
function prefix_pgmm_item($itemContent) { $itemContent = ''; $itemContent .= ' <a href="'. get_permalink() .'">'; $itemContent .= ' '. get_the_title(); $itemContent .= ' </a>'; $itemContent .= wpautop(get_post_meta(get_the_ID(), '_pronamic_google_maps_address', true)); global $post; $MYvar = do_shortcode( '[yasr_overall_rating]' ); $itemContent .= $MYvar; return $itemContent; } add_filter('pronamic_google_maps_mashup_item', 'prefix_pgmm_item');
$MYvar doesn’t show anything.
Any idea?https://www.ads-software.com/plugins/yet-another-stars-rating/
- The topic ‘Shortcode in functions.php’ is closed to new replies.