From 903e3e8acd1f3b877cbe13d0141aea353b7b44d9 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Tue, 10 Apr 2018 14:58:06 +0100 Subject: [PATCH] Fix featured filter --- includes/api/class-wc-rest-products-controller.php | 1 + includes/api/legacy/class-wc-rest-legacy-products-controller.php | 1 + 2 files changed, 2 insertions(+) diff --git a/includes/api/class-wc-rest-products-controller.php b/includes/api/class-wc-rest-products-controller.php index de27f4ad203..a2fd0b45cc0 100644 --- a/includes/api/class-wc-rest-products-controller.php +++ b/includes/api/class-wc-rest-products-controller.php @@ -246,6 +246,7 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller { 'taxonomy' => 'product_visibility', 'field' => 'name', 'terms' => 'featured', + 'operator' => true === $request['featured'] ? 'IN' : 'NOT IN', ); } diff --git a/includes/api/legacy/class-wc-rest-legacy-products-controller.php b/includes/api/legacy/class-wc-rest-legacy-products-controller.php index 3539febc6fc..9096cbd0f98 100644 --- a/includes/api/legacy/class-wc-rest-legacy-products-controller.php +++ b/includes/api/legacy/class-wc-rest-legacy-products-controller.php @@ -94,6 +94,7 @@ class WC_REST_Legacy_Products_Controller extends WC_REST_CRUD_Controller { 'taxonomy' => 'product_visibility', 'field' => 'name', 'terms' => 'featured', + 'operator' => true === $request['featured'] ? 'IN' : 'NOT IN', ); }