Delete term count transients after stock status change and trashed post
Closes #5286
This commit is contained in:
parent
99592a3efc
commit
8b59eb3bdb
|
@ -189,6 +189,7 @@ class WC_Admin_Post_Types {
|
|||
}
|
||||
|
||||
delete_transient( 'woocommerce_processing_order_count' );
|
||||
delete_transient( 'wc_term_counts' );
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -217,6 +218,7 @@ class WC_Admin_Post_Types {
|
|||
}
|
||||
|
||||
delete_transient( 'woocommerce_processing_order_count' );
|
||||
delete_transient( 'wc_term_counts' );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -503,6 +503,8 @@ function wc_recount_after_stock_change( $product_id ) {
|
|||
|
||||
_wc_term_recount( $product_tags, get_taxonomy( 'product_tag' ), false, false );
|
||||
}
|
||||
|
||||
delete_transient( 'wc_term_counts' );
|
||||
}
|
||||
add_action( 'woocommerce_product_set_stock_status', 'wc_recount_after_stock_change' );
|
||||
|
||||
|
|
Loading…
Reference in New Issue