WC_Product_Data_Store_CPT::clear_caches( WC_Product $product )
Clear any caches.
Description Description
Parameters Parameters
- $product
-
(Required) Product object.
Source Source
File: includes/data-stores/class-wc-product-data-store-cpt.php
protected function clear_caches( &$product ) { wc_delete_product_transients( $product->get_id() ); if ( $product->get_parent_id( 'edit' ) ) { wc_delete_product_transients( $product->get_parent_id( 'edit' ) ); WC_Cache_Helper::invalidate_cache_group( 'product_' . $product->get_parent_id( 'edit' ) ); } WC_Cache_Helper::invalidate_attribute_count( array_keys( $product->get_attributes() ) ); WC_Cache_Helper::invalidate_cache_group( 'product_' . $product->get_id() ); }
Changelog Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |