woocommerce_enable_post_clause_filtering
Filter whether to add the filter post clauses
Usage
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.
Changelog
| Since 9.9.0 | Introduced. |
Where the hook is called
woocommerce_enable_post_clause_filtering
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 685
$enable_filtering = apply_filters( 'woocommerce_enable_post_clause_filtering', $wp_query->is_main_query(), $wp_query );