WC_Product_Data_Store_CPT::update_review_count()
Update a products review count meta.
Method of the class: WC_Product_Data_Store_CPT{}
No Hooks.
Return
null
. Nothing (null).
Usage
$WC_Product_Data_Store_CPT = new WC_Product_Data_Store_CPT(); $WC_Product_Data_Store_CPT->update_review_count( $product );
- $product(WC_Product) (required)
- Product object.
Changelog
Since 3.0.0 | Introduced. |
WC_Product_Data_Store_CPT::update_review_count() WC Product Data Store CPT::update review count code WC 9.4.2
public function update_review_count( $product ) { update_post_meta( $product->get_id(), '_wc_review_count', $product->get_review_count( 'edit' ) ); }