[wp-trac] [WordPress Trac] #34479: New get_orderby() method of class-wp-posts-list-table.class doesn't allow query orderby var to be an array

WordPress Trac noreply at wordpress.org
Sat Nov 7 03:38:52 UTC 2015


#34479: New get_orderby() method of class-wp-posts-list-table.class doesn't allow
query orderby var to be an array
-------------------------------------+-----------------------------
 Reporter:  szaqal21                 |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  4.4
Component:  Posts, Post Types        |     Version:  trunk
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:  administration
-------------------------------------+-----------------------------
Changes (by bordoni):

 * keywords:  needs-patch => has-patch needs-testing


Comment:

 I've created a patch that will resolve the issue, but I'm not 100% sure
 that if that cover all the bases for the ordering on the Administration
 Table, on my testing there were no issues when you tried to overwrite the
 OrderBy.

 The patch N0 above will work for both associative and numeric arrays on
 OrderBy

 {{{#!php
 <?php

 $query->set( 'orderby', array( 'menu_order', 'title' ) );
 // OR
 $query->set( 'orderby', array( 'menu_order' => 'asc', 'title' => 'desc' )
 );
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34479#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list