Last active
December 12, 2020 20:32
-
-
Save Alimir/292fd10ba78e077ef0a244450364068d to your computer and use it in GitHub Desktop.
wp ulike custom hreview
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function wp_ulike_pro_custom_hreview( $content ){ | |
global $post; | |
if( is_singular() && 0 != ( $counter = wp_ulike_get_post_likes( $post->ID ) ) ){ | |
$content .= sprintf('<div style="display:none" class="hreview-aggregate"> | |
<div class=item> | |
<p class="fn">%s</p> | |
</div> | |
<span class=rating>%s</span> | |
<span class=count>%s</span> | |
</div>', | |
$post->post_title, | |
wp_ulike_get_rating_value( $post->ID ), | |
$counter | |
); | |
} | |
return $content; | |
} | |
add_filter('the_content', 'wp_ulike_pro_custom_hreview'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment