WC_Query::remove_product_query_filterspublicWC 1.0

Pre_get_posts above may adjust the main query to add WooCommerce logic. When this query is done, we need to ensure all custom filters are removed.

This is done here during the_posts filter. The input is not changed.

Method of the class: WC_Query{}

No Hooks.

Returns

Array.

Usage

$WC_Query = new WC_Query();
$WC_Query->remove_product_query_filters( $posts );
$posts(array) (required)
Posts from WP Query.

WC_Query::remove_product_query_filters() code WC 11.0.1

public function remove_product_query_filters( $posts ) {
	$this->remove_ordering_args();
	remove_filter( 'posts_clauses', array( $this, 'price_filter_post_clauses' ), 10, 2 );
	return $posts;
}