wc_recount_all_terms()
Recounts all terms.
No Hooks.
Return
null
. Nothing (null).
Usage
wc_recount_all_terms();
Changelog
Since 5.2 | Introduced. |
wc_recount_all_terms() wc recount all terms code WC 9.6.1
function wc_recount_all_terms() { $product_cats = get_terms( 'product_cat', array( 'hide_empty' => false, 'fields' => 'id=>parent', ) ); _wc_term_recount( $product_cats, get_taxonomy( 'product_cat' ), true, false ); $product_tags = get_terms( 'product_tag', array( 'hide_empty' => false, 'fields' => 'id=>parent', ) ); _wc_term_recount( $product_tags, get_taxonomy( 'product_tag' ), true, false ); }