[wp-trac] [WordPress Trac] #14645: Support for multiple meta_key => meta_value pairs in WP_Query

WordPress Trac wp-trac at lists.automattic.com
Tue Aug 31 14:14:40 UTC 2010


#14645: Support for multiple meta_key => meta_value pairs in WP_Query
-------------------------+--------------------------------------------------
 Reporter:  joehoyle     |        Owner:                 
     Type:  enhancement  |       Status:  reopened       
 Priority:  normal       |    Milestone:  Awaiting Review
Component:  Query        |      Version:                 
 Severity:  normal       |   Resolution:                 
 Keywords:               |  
-------------------------+--------------------------------------------------
Changes (by aaroncampbell):

 * cc: aaroncampbell (added)


Comment:

 I have to agree that it would be nice to be able to query on multiple bits
 of meta data.  For example, it would be nice to on one of my site
 (http://shouldipourit.com) to find beers that are bitter and highly rated,
 so I'd like to compare
 {{{
 meta_key='_rating' && meta_value >= 4
 meta_key='_ibu' && meta_value >= 50
 }}}

 Neither of those make sense as taxonomies since you need to be able to
 query them in ranges but still retain the exact value (I don't see the
 need to find a beer where the IBU is exactly 64, but if you're looking at
 a beer you want to know that it's IBU is 64)

 I've run into this on other sites where we store course date, cost, and
 teacher as meta, etc.  In my experience it's a fairly common need
 (although your mileage may vary).

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


More information about the wp-trac mailing list