[wp-trac] [WordPress Trac] #15031: order via meta_query

WordPress Trac wp-trac at lists.automattic.com
Fri Mar 4 02:55:23 UTC 2011


#15031: order via meta_query
---------------------------+-----------------------------
 Reporter:  aaroncampbell  |       Owner:  scribu
     Type:  enhancement    |      Status:  new
 Priority:  normal         |   Milestone:  Future Release
Component:  Query          |     Version:  3.1
 Severity:  normal         |  Resolution:
 Keywords:  dev-feedback   |
---------------------------+-----------------------------

Comment (by scribu):

 I was thinking of something like this:

 {{{
 'meta_query' => array(
   array(
     'meta_key' => 'foo',
     'order' => 'ASC',
     'order_priority' => 2
   ),
   array(
     'meta_key' => 'bar',
     'order' => 'DESC',
     'order_priority' => 1
   ),
 )
 }}}

 which would result in this SQL:

 {{{
 ORDER BY wp_postmeta_alias2.meta_value DESC, wp_postmeta_alias1.meta_value
 ASC
 }}}

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


More information about the wp-trac mailing list