From 1868311c6ff7699c72d6d71668a1a0b9878545fe Mon Sep 17 00:00:00 2001 From: "Jorge A. Torres" Date: Tue, 4 Apr 2023 10:48:19 -0500 Subject: [PATCH 1/2] =?UTF-8?q?Change=20default=20order=20to=20=E2=80=98da?= =?UTF-8?q?te=20DESC=E2=80=99=20in=20orders=20list=20table?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/woocommerce/src/Internal/Admin/Orders/ListTable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/woocommerce/src/Internal/Admin/Orders/ListTable.php b/plugins/woocommerce/src/Internal/Admin/Orders/ListTable.php index e182f13ae9d..02745c54589 100644 --- a/plugins/woocommerce/src/Internal/Admin/Orders/ListTable.php +++ b/plugins/woocommerce/src/Internal/Admin/Orders/ListTable.php @@ -365,7 +365,7 @@ class ListTable extends WP_List_Table { $direction = strtoupper( sanitize_text_field( wp_unslash( $_GET['order'] ?? '' ) ) ); if ( ! in_array( $field, $sortable, true ) ) { - $this->order_query_args['orderby'] = 'id'; + $this->order_query_args['orderby'] = 'date'; $this->order_query_args['order'] = 'DESC'; return; } From 4250e9d7b5ec3bab5f75a893b1a845182b351e5c Mon Sep 17 00:00:00 2001 From: "Jorge A. Torres" Date: Tue, 4 Apr 2023 10:52:52 -0500 Subject: [PATCH 2/2] Add changelog --- plugins/woocommerce/changelog/fix-36498 | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 plugins/woocommerce/changelog/fix-36498 diff --git a/plugins/woocommerce/changelog/fix-36498 b/plugins/woocommerce/changelog/fix-36498 new file mode 100644 index 00000000000..574e324e7bb --- /dev/null +++ b/plugins/woocommerce/changelog/fix-36498 @@ -0,0 +1,4 @@ +Significance: patch +Type: tweak + +Default to sorting orders by date (desc) when HPOS is active.