WC_Query::remove_product_query_filters()publicWC 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.

Метод класса: WC_Query{}

Хуков нет.

Возвращает

Массив.

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

$WC_Query = new WC_Query();
$WC_Query->remove_product_query_filters( $posts );
$posts(массив) (обязательный)
Posts from WP Query.

Код WC_Query::remove_product_query_filters() WC 8.7.0

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;
}