woocommerce_product_recount_terms хук-фильтрWC 5.2

Filter to allow/prevent recounting of terms as it could be expensive. A likely scenario for this is when bulk importing products. We could then prevent it from recounting per product but instead recount it once when import is done. Of course this means the import logic has to support this.

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

add_filter( 'woocommerce_product_recount_terms', 'wp_kama_woocommerce_product_recount_terms_filter' );

/**
 * Function for `woocommerce_product_recount_terms` filter-hook.
 * 
 * @param bool $true 
 *
 * @return bool
 */
function wp_kama_woocommerce_product_recount_terms_filter( $true ){

	// filter...
	return $true;
}
$true(true|false)
-

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

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

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

_wc_term_recount()
woocommerce_product_recount_terms
woocommerce/includes/wc-term-functions.php 404
if ( ! apply_filters( 'woocommerce_product_recount_terms', true ) ) {

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

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