Merge pull request #28745 from woocommerce/fix/28741
Revert order and product controllers to use WP Post queries directly.
This commit is contained in:
commit
e74bc15103
|
@ -25,25 +25,6 @@ class WC_REST_Orders_Controller extends WC_REST_Orders_V2_Controller {
|
|||
*/
|
||||
protected $namespace = 'wc/v3';
|
||||
|
||||
|
||||
/**
|
||||
* Get Orders.
|
||||
*
|
||||
* @param array $query_args Query args.
|
||||
*
|
||||
* @return array Products.
|
||||
*/
|
||||
protected function get_objects( $query_args ) {
|
||||
$query_args['paginate'] = true;
|
||||
$results = wc_get_orders( $query_args );
|
||||
|
||||
return array(
|
||||
'objects' => $results->orders,
|
||||
'total' => $results->total,
|
||||
'pages' => $results->max_num_pages,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate coupons.
|
||||
*
|
||||
|
|
|
@ -220,25 +220,6 @@ class WC_REST_Products_Controller extends WC_REST_Products_V2_Controller {
|
|||
return $args;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get products.
|
||||
*
|
||||
* @param array $query_args Query args.
|
||||
*
|
||||
* @return array Products.
|
||||
*/
|
||||
protected function get_objects( $query_args ) {
|
||||
$query_args['paginate'] = true;
|
||||
$query_args['return'] = 'objects';
|
||||
$results = wc_get_products( $query_args );
|
||||
|
||||
return array(
|
||||
'objects' => $results->products,
|
||||
'total' => $results->total,
|
||||
'pages' => $results->max_num_pages,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set product images.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue