[wp-trac] [WordPress Trac] #17065: Independent ASC/DESC in multiple ORDER BY statement.

WordPress Trac wp-trac at lists.automattic.com
Wed Apr 6 17:43:07 UTC 2011


#17065: Independent ASC/DESC in multiple ORDER BY statement.
-------------------------+------------------------------
 Reporter:  ericmann     |       Owner:  ericmann
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Query        |     Version:  3.1
 Severity:  trivial      |  Resolution:
 Keywords:  needs-patch  |
-------------------------+------------------------------

Comment (by ericmann):

 Not at the moment. My first attempt allowed users to pass an array into
 'orderby' rather than just a string. So:

 {{{
 $args = array(
     'post_type' => 'post'
     'orderby' => array(
         'author ASC',
         'date DESC'
     )
 );
 }}}

 The advantage to this approach is that it wouldn't break backwards compat.
 Disadvantage is that is combines the behavior of 'orderby' and 'order' and
 could confuse people ... particularly if they use both parameters.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17065#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list