WordPress at Your Fingertips
function is not described

WC_Product::get_rating_count() public WC 1.0

Get the total amount (COUNT) of ratings, or just the count for one rating e.g. number of 5 star ratings.

{} It's a method of the class: WC_Product{}

No Hooks.

Return

Int.

Usage

$WC_Product = new WC_Product();
$WC_Product->get_rating_count( $value );
$value(int)
Rating value to get the count for. By default returns the count of all rating values.

Code of WC_Product::get_rating_count() WC 5.5.2

<?php
public function get_rating_count( $value = null ) {
	$counts = $this->get_rating_counts();

	if ( is_null( $value ) ) {
		return array_sum( $counts );
	} elseif ( isset( $counts[ $value ] ) ) {
		return absint( $counts[ $value ] );
	} else {
		return 0;
	}
}