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

WordPress Trac wp-trac at lists.automattic.com
Wed Apr 6 22:59:18 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  |
-------------------------+------------------------------
Changes (by pento):

 * cc: gary@… (added)


Comment:

 c/p my syntax proposal from #15031. Allows for backwards compatibility,
 doesn't combine 'orderby' and 'order', allows for meta queries:


 {{{
 $args = array(
   'post_type => 'post',
   'orderby' => array(
     array(
       'meta_key' => 'bar',
       'order' => 'DESC',
     ),
     array(
       'key' => 'date',
       'order' => 'DESC',
     ),
     array(
       'meta_key' => 'foo',
       'order' => 'ASC',
     )
   )
 )
 }}}

 The disadvantage is multi-level arrays, but we're already using them for
 'tax_query'.

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


More information about the wp-trac mailing list