WC_Comments::get_review_count_for_product()public staticWC 3.0.0

Get product review count for a product (not replies). Please note this is not cached.

Метод класса: WC_Comments{}

Хуков нет.

Возвращает

int.

Использование

$result = WC_Comments::get_review_count_for_product( $product );
$product(WC_Product) (обязательный) (передается по ссылке — &)
Product instance.

Список изменений

С версии 3.0.0 Введена.

Код WC_Comments::get_review_count_for_product() WC 8.7.0

public static function get_review_count_for_product( &$product ) {
	$counts = self::get_review_counts_for_product_ids( array( $product->get_id() ) );

	return $counts[ $product->get_id() ];
}