gdrts_render_list_like_this_args_rating

Filter gdrts_render_list_like_this_args_rating is used to filter the parameters used for the rendering of rating text in the rating list for Stars Rating method templates. This filter has several arguments:

  • $atts: the array of parameters to filter
  • $render_object: the instance of the render object
  • $_rating: rating value

Array $atts contains following elements:

  • before: HTML to show before the rating text.
  • after: HTML to show after the rating text.
  • likes: the string showing number of votes. By default, this is {$_rating} person likes this.|{$_rating} people like this.

Example to change rating/votes strings

add_filter('gdrts_render_list_like_this_args_rating', 'custom__gdrts_render_list_like_this_args_rating', 10, 3);
function custom__gdrts_render_list_like_this_args_rating($atts, $obj, $_rating) {
  $atts['likes'] = sprintf(_n("%s person likes this.", "%s people like this.", $_rating, "gd-rating-system"), $_rating);

  return $atts;
}
0
0
102
Rate this reference

You are not allowed to rate this post.

Comments

Leave a Reply