WordPress at Your Fingertips
function is not described

wc_recount_all_terms() WC 5.2

Recounts all terms.

No Hooks.

Return

null. Nothing.

Usage

wc_recount_all_terms();

Changelog

Since 5.2 Introduced.

Code of wc_recount_all_terms() WC 5.8.0

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