diff --git a/includes/admin/class-wc-admin-post-types.php b/includes/admin/class-wc-admin-post-types.php index 907c4138af5..ae9dabd4313 100644 --- a/includes/admin/class-wc-admin-post-types.php +++ b/includes/admin/class-wc-admin-post-types.php @@ -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' ); } } diff --git a/includes/wc-term-functions.php b/includes/wc-term-functions.php index 24043db2679..2ffe92ef426 100644 --- a/includes/wc-term-functions.php +++ b/includes/wc-term-functions.php @@ -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' );