From 6e24b85c6baf4b6240854387aa1213f5a15c8149 Mon Sep 17 00:00:00 2001 From: Peter Fabian Date: Thu, 14 Feb 2019 17:03:53 +0100 Subject: [PATCH] Put back status parameter after extra processing. This allows correct further processing of $request, e.g. for next/previous links, etc. --- includes/api/class-wc-rest-orders-controller.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/api/class-wc-rest-orders-controller.php b/includes/api/class-wc-rest-orders-controller.php index f348b59f8cb..62b86306d53 100644 --- a/includes/api/class-wc-rest-orders-controller.php +++ b/includes/api/class-wc-rest-orders-controller.php @@ -210,7 +210,7 @@ class WC_REST_Orders_Controller extends WC_REST_Orders_V2_Controller { * @return array */ protected function prepare_objects_query( $request ) { - // This is needed to get around an array to string notice in WC_REST_Orders_Controller::prepare_objects_query. + // This is needed to get around an array to string notice in WC_REST_Orders_V2_Controller::prepare_objects_query. $statuses = $request['status']; unset( $request['status'] ); $args = parent::prepare_objects_query( $request ); @@ -228,6 +228,9 @@ class WC_REST_Orders_Controller extends WC_REST_Orders_V2_Controller { } } + // Put the statuses back for further processing (next/prev links, etc). + $request['status'] = $statuses; + return $args; }