wc_delete_product_transients for parent

This commit is contained in:
Mike Jolley 2019-01-18 23:24:43 +00:00
parent 8ede6bcb74
commit 7744879326
1 changed files with 4 additions and 0 deletions

View File

@ -829,6 +829,10 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
*/
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_attribute_count( array_keys( $product->get_attributes() ) );
WC_Cache_Helper::incr_cache_prefix( 'product_' . $product->get_id() );
}