From 05ab331ea81ca409910c853873e4cabc4857f01d Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Fri, 25 Jan 2019 19:56:12 +0000 Subject: [PATCH] No need for default sorting --- .../api/legacy/v3/class-wc-api-products.php | 20 +------------------ 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/includes/api/legacy/v3/class-wc-api-products.php b/includes/api/legacy/v3/class-wc-api-products.php index e8a8c3a9ede..1f92277044c 100644 --- a/includes/api/legacy/v3/class-wc-api-products.php +++ b/includes/api/legacy/v3/class-wc-api-products.php @@ -2760,25 +2760,7 @@ class WC_API_Products extends WC_API_Resource { throw new WC_API_Exception( 'woocommerce_api_invalid_product_attribute_id', __( 'A product attribute with the provided ID could not be found', 'woocommerce' ), 404 ); } - $args = array( 'hide_empty' => false ); - $orderby = wc_attribute_orderby( $taxonomy ); - - switch ( $orderby ) { - case 'name' : - $args['orderby'] = 'name'; - $args['menu_order'] = false; - break; - case 'id' : - $args['orderby'] = 'id'; - $args['order'] = 'ASC'; - $args['menu_order'] = false; - break; - case 'menu_order' : - $args['menu_order'] = 'ASC'; - break; - } - - $terms = get_terms( $taxonomy, $args ); + $terms = get_terms( $taxonomy, array( 'hide_empty' => false ) ); $attribute_terms = array(); foreach ( $terms as $term ) {