Skip to content

Template Tags

Pascal Birchler edited this page May 11, 2017 · 1 revision

The plugin provides template tags for retrieving the post like count or even the complete markup for the like button. For posts it'd look like this:

Function Description
get_rest_post_like_count( 123 ) Returns the raw like count for the post with the ID 123.
the_rest_post_like_count() Prints the like count markup for the current post. The number inside is properly formatted using number_format_i18n()
get_rest_post_like_button( 123 ) Returns the like button markup for the post with the ID 123.
the_rest_post_like_button() Prints the like button markup for the current post.

Similarly, you can use get_rest_comment_like_count() and the like for comments.

Clone this wiki locally