woocommerce_change_term_counts хук-фильтрWC 2.1.0

Filter which product taxonomies should have their term counts overridden to take catalog visibility into account.

Использование

add_filter( 'woocommerce_change_term_counts', 'wp_kama_woocommerce_change_term_counts_filter' );

/**
 * Function for `woocommerce_change_term_counts` filter-hook.
 * 
 * @param array $valid_taxonomies List of taxonomy slugs.
 *
 * @return array
 */
function wp_kama_woocommerce_change_term_counts_filter( $valid_taxonomies ){

	// filter...
	return $valid_taxonomies;
}
$valid_taxonomies(массив)
List of taxonomy slugs.

Список изменений

С версии 2.1.0 Введена.

Где вызывается хук

wc_change_term_counts()
woocommerce_change_term_counts
woocommerce/includes/wc-term-functions.php 599
$valid_taxonomies   = apply_filters( 'woocommerce_change_term_counts', array( 'product_cat', 'product_tag', 'product_brand' ) );

Где используется хук в WooCommerce

Использование не найдено.