When you call add_filter()
, set the fourth parameter to 3
(which is the number of parameters accepted by the callback function which in your case is change_rating_output()
), and then change your change_rating_output()
function so that it accepts the $rating
and $count
parameters:
add_filter('woocommerce_product_get_rating_html', 'change_rating_output', 10, 3);
function change_rating_output($html, $rating, $count){
// Now do what you want with $rating and $count
return $html;
}
See http://developer.wordpress.org/reference/functions/add_filter/ for further details.