Change default order to ‘date DESC’ in orders list table (#37565)
This commit is contained in:
commit
8be211b45b
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: tweak
|
||||
|
||||
Default to sorting orders by date (desc) when HPOS is active.
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue