Developer Knowledge Level

This content is intended for WordPress developers, and it may require coding knowledge of WordPress, PHP, and JavaScript. Code examples provided here may contain errors or needs some additional coding. Make sure to test the code before using it on a live website!

gdrts_loop()->render()->likes($args = array(), $echo = true);

Description

Render the likes block. This method is used by Like This method to display rating element stars. Depending on the rating method, $args array contains different parameters.

Parameters for $args

Like This, Single Block

  • allow_rating: if set to false, the rating will be disabled.
  • show_votes: show votes count.
  • labels: associative array with the list of labels to use. Leave to null, do use default values.

If you need to modify all the styling properties (style type, name…), you should use the filter that runs before the template is actually loaded:

Like This, Rating List

  • show_votes: show votes count.
  • labels: associative array with the list of labels to use.

If you need to modify all the styling properties (style type, name…), you should use the filter that runs before the template is actually loaded:

Labels Array

This associative array contains 3 values:

  • liked: default ‘Liked’
  • like: default ‘Like’
  • unlike: default ‘Unlike’
0
0
534
Rate this reference

You are not allowed to rate this post.

Comments

Leave a Reply