From aeb07b5fd8c5a15a35de64efc2f627ad8508aecb Mon Sep 17 00:00:00 2001 From: Shiva Poudel Date: Sun, 5 Nov 2017 21:37:42 +0545 Subject: [PATCH] Tweak - Order number to be sortable column CC @mikejolley --- .../list-tables/abstract-class-wc-admin-list-table.php | 4 ++-- .../list-tables/class-wc-admin-list-table-coupons.php | 2 +- .../list-tables/class-wc-admin-list-table-orders.php | 10 +++++----- .../list-tables/class-wc-admin-list-table-products.php | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/includes/admin/list-tables/abstract-class-wc-admin-list-table.php b/includes/admin/list-tables/abstract-class-wc-admin-list-table.php index 9172cdf82e5..2ac3e91d11a 100644 --- a/includes/admin/list-tables/abstract-class-wc-admin-list-table.php +++ b/includes/admin/list-tables/abstract-class-wc-admin-list-table.php @@ -89,7 +89,7 @@ abstract class WC_Admin_List_Table { * it, so we want to hide the useless UI from the screen options tab. * * @param array $post_types Array of post types supporting view mode. - * @return array Array of post types supporting view mode, without products, orders, and coupons. + * @return array Array of post types supporting view mode, without this type. */ public function disable_view_mode( $post_types ) { unset( $post_types[ $this->list_table_type ] ); @@ -192,7 +192,7 @@ abstract class WC_Admin_List_Table { } /** - * Define primary column; + * Define primary column. * * @return array */ diff --git a/includes/admin/list-tables/class-wc-admin-list-table-coupons.php b/includes/admin/list-tables/class-wc-admin-list-table-coupons.php index b57dfcfc639..a9f91cee020 100644 --- a/includes/admin/list-tables/class-wc-admin-list-table-coupons.php +++ b/includes/admin/list-tables/class-wc-admin-list-table-coupons.php @@ -52,7 +52,7 @@ class WC_Admin_List_Table_Coupons extends WC_Admin_List_Table { } /** - * Define primary column; + * Define primary column. * * @return array */ diff --git a/includes/admin/list-tables/class-wc-admin-list-table-orders.php b/includes/admin/list-tables/class-wc-admin-list-table-orders.php index a2ecfc20630..1bd3be8e13b 100644 --- a/includes/admin/list-tables/class-wc-admin-list-table-orders.php +++ b/includes/admin/list-tables/class-wc-admin-list-table-orders.php @@ -56,7 +56,7 @@ class WC_Admin_List_Table_Orders extends WC_Admin_List_Table { } /** - * Define primary column; + * Define primary column. * * @return array */ @@ -95,9 +95,9 @@ class WC_Admin_List_Table_Orders extends WC_Admin_List_Table { */ public function define_sortable_columns( $columns ) { $custom = array( - 'order_title' => 'ID', - 'order_total' => 'order_total', - 'order_date' => 'date', + 'order_number' => 'ID', + 'order_total' => 'order_total', + 'order_date' => 'date', ); unset( $columns['comments'] ); @@ -414,7 +414,7 @@ class WC_Admin_List_Table_Orders extends WC_Admin_List_Table { } $redirect_to = add_query_arg( array( - 'post_type' => 'shop_order', + 'post_type' => $this->list_table_type, $report_action => true, 'changed' => $changed, 'ids' => join( ',', $ids ), diff --git a/includes/admin/list-tables/class-wc-admin-list-table-products.php b/includes/admin/list-tables/class-wc-admin-list-table-products.php index 13b108c3d76..3f09d0ace0d 100644 --- a/includes/admin/list-tables/class-wc-admin-list-table-products.php +++ b/includes/admin/list-tables/class-wc-admin-list-table-products.php @@ -56,7 +56,7 @@ class WC_Admin_List_Table_Products extends WC_Admin_List_Table { } /** - * Define primary column; + * Define primary column. * * @return array */