Clear parent transients on variation save
This commit is contained in:
parent
4edcdd0fb1
commit
0694312cc9
|
@ -155,6 +155,11 @@ class WC_Product_Variation_Data_Store_CPT extends WC_Product_Data_Store_CPT impl
|
|||
) );
|
||||
}
|
||||
|
||||
if ( isset( $changes['parent_id'] ) ) {
|
||||
delete_transient( 'wc_product_children_' . $product->get_parent_id( 'edit' ) );
|
||||
delete_transient( 'wc_product_children_' . $this->data['parent_id'] );
|
||||
}
|
||||
|
||||
$this->update_post_meta( $product );
|
||||
$this->update_terms( $product );
|
||||
$this->update_attributes( $product );
|
||||
|
|
|
@ -360,7 +360,6 @@ class WC_Tests_Product_Data_Store extends WC_Unit_Test_Case {
|
|||
$variation->save();
|
||||
|
||||
$product = wc_get_product( $product->get_id() );
|
||||
$product->sync( $product );
|
||||
|
||||
$store = new WC_Product_Variable_Data_Store_CPT();
|
||||
|
||||
|
@ -376,7 +375,6 @@ class WC_Tests_Product_Data_Store extends WC_Unit_Test_Case {
|
|||
$variation->save();
|
||||
|
||||
$product = wc_get_product( $product->get_id() );
|
||||
$product->sync( $product );
|
||||
|
||||
$store = new WC_Product_Variable_Data_Store_CPT();
|
||||
|
||||
|
|
Loading…
Reference in New Issue