Merge pull request #28745 from woocommerce/fix/28741

Revert order and product controllers to use WP Post queries directly.
This commit is contained in:
Vedanshu Jain 2021-01-07 17:37:25 +05:30 committed by GitHub
commit e74bc15103
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 38 deletions

View File

@ -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.
*

View File

@ -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.
*