WordPress at Your Fingertips
function is not described

WC_Product_Data_Store_CPT::update_rating_counts() public WC 3.0.0

Update a products rating counts.

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

No Hooks.

Return

null. Nothing.

Usage

$WC_Product_Data_Store_CPT = new WC_Product_Data_Store_CPT();
$WC_Product_Data_Store_CPT->update_rating_counts( $product );
$product(WC_Product) (required)
Product object.

Changelog

Since 3.0.0 Introduced.

Code of WC_Product_Data_Store_CPT::update_rating_counts() WC 5.6.0

public function update_rating_counts( $product ) {
	update_post_meta( $product->get_id(), '_wc_rating_count', $product->get_rating_counts( 'edit' ) );
}