gdrts_render_list_stars_review_args_rating

Filter gdrts_render_single_stars_review_args_rating is used to filter the parameters used for the rendering of rating text in the rating list for Stars Review 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
  • $_stars: max number of stars

Array $atts contains following elements:

  • before: HTML to show before the rating text.
  • after: HTML to show after the rating text.
  • rating: the string showing the rating. By default, this is: Rating: <strong>{$_rating}</strong>/{$_stars}.

Example to change rating/votes strings

add_filter('gdrts_render_list_stars_review_args_rating', 'custom__gdrts_render_list_stars_review_args_rating', 10, 5);
function custom__gdrts_render_list_stars_review_args_rating($atts, $obj, $_rating, $_stars, $_votes) {
  $atts['rating'] = sprintf('Rating: <strong>%s</strong>.', $_rating);

  return $atts;
}
0
0
99
Rate this reference

You are not allowed to rate this post.

Comments

Leave a Reply