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; }