Delete term count transients after stock status change and trashed post

Closes #5286
This commit is contained in:
Mike Jolley 2014-04-07 15:16:54 +01:00
parent 99592a3efc
commit 8b59eb3bdb
2 changed files with 4 additions and 0 deletions

View File

@ -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' );
}
}

View File

@ -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' );