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

WordPress Trac wp-trac at lists.automattic.com
Fri Mar 4 15:44:02 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 2nd-opinion  |
--------------------------------------+-----------------------------
Changes (by aaroncampbell):

 * keywords:  dev-feedback => dev-feedback 2nd-opinion


Comment:

 Replying to [comment:7 scribu]:

 I like the idea, but I have a couple questions:
 1. Do we need order_priority?  Can we just ask that people add the meta
 queries in the order they want them handled?  To create the same sql as
 you have above you'd just do this:
 {{{
 'meta_query' => array(
   array(
     'meta_key' => 'bar',
     'order' => 'DESC',
   ),
   array(
     'meta_key' => 'foo',
     'order' => 'ASC',
   ),
 )
 }}}
 1. Also, How do we plan to integrate these order clauses with the existing
 order stuff?  For example, would it be possible to sort by "date,
 meta_value" or "meta_value, date"?  Maybe the order_priority could be
 useful here, assuming that other order clauses are priority x, and
 anything with a priority < x comes before and anything with priority > x
 comes after? I know we don't have to offer every single option, but I
 think we need to decide what would be useful and make sure we account for
 that.

 I'd also like to bounce this off a couple more people and get additional
 feedback.

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


More information about the wp-trac mailing list