WordPress at Your Fingertips
function is not described

WC_Abstract_Legacy_Product::sync_rating_count() public WC 1.0

Deprecated from version 3.0.0. It is no longer supported and can be removed in future releases. It is recommended to replace this function with the same one.

Sync product rating count. Can be called statically.

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

No Hooks.

Return

null. Nothing.

Usage

$result = WC_Abstract_Legacy_Product::sync_rating_count( $post_id );
$post_id(int) (required)
-

Changelog

Deprecated 3.0.0

Code of WC_Abstract_Legacy_Product::sync_rating_count() WC 5.7.1

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 );
}