Merge pull request #22741 from woocommerce/fix/22701

Put back status parameter after extra processing.
This commit is contained in:
Mike Jolley 2019-02-18 16:41:20 +00:00 committed by GitHub
commit 624431d875
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

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