gdrts_calculate_thumbs_rating_item

This filter (gdrts_calculate_thumbs_rating_item) is used to filter item after the vote calculations have been done after voting.

This filter provides 4 arguments. Using this filter allows modifications to the $item and even modification of the calculated ratings. Do not use if you are not sure what this can do.

Arguments

  • $item: item used to do calculations for.
  • $action: action can be vote or revote.
  • $vote: vote added to the calculation.
  • $previous: if $action is a revote, this is the vote being replaced.

Example

add_filter('gdrts_calculate_thumbs_rating_item', 'custom__gdrts_calculate_thumbs_rating_item', 10, 4);
function custom__gdrts_calculate_thumbs_rating_item($item, $action, $vote, $previous) {
  // modify the $item object //

  // return the $item object//
  return $item;
}
1
0
243
Rate this reference

You are not allowed to rate this post.

Comments

Leave a Reply