From 67e4f0731eb6ff62bfb3e0c07b0f0881481294e6 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Mon, 21 Oct 2013 13:05:34 +0100 Subject: [PATCH] remove_ordering_args from .18 --- includes/class-wc-query.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/includes/class-wc-query.php b/includes/class-wc-query.php index 1ef9511c755..adefbcb2513 100644 --- a/includes/class-wc-query.php +++ b/includes/class-wc-query.php @@ -59,7 +59,8 @@ class WC_Query { add_action( 'parse_request', array( $this, 'parse_request'), 0 ); add_filter( 'pre_get_posts', array( $this, 'pre_get_posts' ) ); add_filter( 'the_posts', array( $this, 'the_posts' ), 11, 2 ); - add_filter( 'wp', array( $this, 'remove_product_query' ) ); + add_action( 'wp', array( $this, 'remove_product_query' ) ); + add_action( 'wp', array( $this, 'remove_ordering_args' ) ); } $this->init_query_vars(); @@ -377,6 +378,14 @@ class WC_Query { remove_filter( 'posts_clauses', array( $this, 'order_by_rating_post_clauses' ) ); } + /** + * Remove ordering queries + */ + public function remove_ordering_args() { + remove_filter( 'posts_clauses', array( $this, 'order_by_popularity_post_clauses' ) ); + remove_filter( 'posts_clauses', array( $this, 'order_by_rating_post_clauses' ) ); + } + /** * Remove the posts_where filter *