woocommerce_enable_post_clause_filtering хук-фильтрWC 9.9.0

Filter whether to add the filter post clauses

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

add_filter( 'woocommerce_enable_post_clause_filtering', 'wp_kama_woocommerce_enable_post_clause_filtering_filter', 10, 2 );

/**
 * Function for `woocommerce_enable_post_clause_filtering` filter-hook.
 * 
 * @param bool     $is_main_query Whether the current query is 'is_main_query'.
 * @param WP_Query $wp_query      The current WP_Query object.
 *
 * @return bool
 */
function wp_kama_woocommerce_enable_post_clause_filtering_filter( $is_main_query, $wp_query ){

	// filter...
	return $is_main_query;
}
$is_main_query(true|false)
Whether the current query is 'is_main_query'.
$wp_query(WP_Query)
The current WP_Query object.

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

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

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

Filterer::filter_by_attribute_post_clauses()
woocommerce_enable_post_clause_filtering
WC_Query::price_filter_post_clauses()
woocommerce_enable_post_clause_filtering
woocommerce/src/Internal/ProductAttributesLookup/Filterer.php 70
$enable_filtering = apply_filters( 'woocommerce_enable_post_clause_filtering', $wp_query->is_main_query(), $wp_query );
woocommerce/includes/class-wc-query.php 681
$enable_filtering = apply_filters( 'woocommerce_enable_post_clause_filtering', $wp_query->is_main_query(), $wp_query );

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

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