Warning: This method has been deprecated.

WC_Abstract_Legacy_Product::sync_rating_count( int $post_id )

Sync product rating count. Can be called statically.


Description Description


Parameters Parameters

$post_id

(Required)


Top ↑

Source Source

File: includes/legacy/abstract-wc-legacy-product.php

	public static function sync_rating_count( $post_id ) {
		wc_deprecated_function( 'WC_Product::sync_rating_count', '3.0', 'WC_Comments::get_rating_counts_for_product or leave to CRUD.' );
		$counts     = WC_Comments::get_rating_counts_for_product( wc_get_product( $post_id ) );
		update_post_meta( $post_id, '_wc_rating_count', $counts );
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.