From 1647e253a0f339047113c02a0cb5934b8c76ecec Mon Sep 17 00:00:00 2001 From: claudiulodro Date: Wed, 26 Apr 2017 11:19:54 -0700 Subject: [PATCH] Add filters --- includes/class-wc-order-query.php | 4 +++- includes/data-stores/class-wc-data-store-wp.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/class-wc-order-query.php b/includes/class-wc-order-query.php index 30039745e5c..d5d88d33763 100644 --- a/includes/class-wc-order-query.php +++ b/includes/class-wc-order-query.php @@ -75,6 +75,8 @@ class WC_Order_Query extends WC_Object_Query { * @return array of WC_Order objects */ public function get_orders() { - return WC_Data_Store::load( 'order' )->query( $this->query_vars ); + $args = apply_filters( 'woocommerce_order_query_args', $this->query_vars ); + $results = WC_Data_Store::load( 'order' )->query( $this->query_vars ); + return apply_filters( 'woocommerce_order_query', $results, $args ); } } diff --git a/includes/data-stores/class-wc-data-store-wp.php b/includes/data-stores/class-wc-data-store-wp.php index 9c2b2a53bdc..3d891d28d40 100644 --- a/includes/data-stores/class-wc-data-store-wp.php +++ b/includes/data-stores/class-wc-data-store-wp.php @@ -251,6 +251,6 @@ class WC_Data_Store_WP { } } - return $wp_query_args; + return apply_filters( 'woocommerce_get_wp_query_args', $wp_query_args, $query_vars ); } }