diff --git a/plugins/woocommerce-admin/includes/api/class-wc-admin-rest-reports-categories-controller.php b/plugins/woocommerce-admin/includes/api/class-wc-admin-rest-reports-categories-controller.php index 2b56213bff3..3aa23d33d49 100644 --- a/plugins/woocommerce-admin/includes/api/class-wc-admin-rest-reports-categories-controller.php +++ b/plugins/woocommerce-admin/includes/api/class-wc-admin-rest-reports-categories-controller.php @@ -252,9 +252,9 @@ class WC_Admin_REST_Reports_Categories_Controller extends WC_REST_Reports_Contro $params['orderby'] = array( 'description' => __( 'Sort collection by object attribute.', 'wc-admin' ), 'type' => 'string', - 'default' => 'date', + 'default' => 'category_id', 'enum' => array( - 'date', + 'category_id', 'items_sold', 'net_revenue', 'orders_count', diff --git a/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-categories-data-store.php b/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-categories-data-store.php index a93953d75ca..9cee07babe8 100644 --- a/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-categories-data-store.php +++ b/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-categories-data-store.php @@ -115,20 +115,6 @@ class WC_Admin_Reports_Categories_Data_Store extends WC_Admin_Reports_Data_Store return $included_categories_str; } - /** - * Maps ordering specified by the user to columns in the database/fields in the data. - * - * @param string $order_by Sorting criterion. - * @return string - */ - protected function normalize_order_by( $order_by ) { - if ( 'date' === $order_by ) { - return 'date_created'; - } - - return $order_by; - } - /** * Compares values in 2 arrays based on criterion specified when called via sort_records. *