• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WooCommerce a2z

WooCommerce a2z

WooCommerce

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / WC_Query::remove_product_query_filters() – 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.

You appear to be a bot. Output may be restricted

Description

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.

Usage

$array = WC_Query::remove_product_query_filters( $posts );

Parameters

$posts
( array ) required – Posts from WP Query.

Returns

array

Source

File name: woocommerce/includes/class-wc-query.php
Lines:

1 to 5 of 5
  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;
  }
 

 View on GitHub View on Trac

Published: 26th November 2019 | Last updated: 8th February 2020

Primary Sidebar

Information

Function name: WC_Query::remove_product_query_filters
Class ref: WC_Query
Plugin ref: WooCommerce
Version: 4.8.0
Sourcefile: includes/class-wc-query.php
File ref: includes/class-wc-query.php
Deprecated?: No
API Letters: P,Q,R,W

Footer

WooCommerce a2z
WooCommerce a2z
WooCommerce
WordPress 5.6
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  woocommerce.wp-a2z.org
© Copyright WooCommerce a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites