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

WordPress Trac wp-trac at lists.automattic.com
Sun Oct 3 17:42:03 UTC 2010


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

Comment(by aaroncampbell):

 14645.002.diff fixes both issues I mentioned above.

 Also, just to clarify, the proper usage is to pass an array of arrays as
 meta_query like this:
 {{{

     query_posts( array(
                 'meta_query'    => array(
                         array(
                                 'meta_key'              => '_abv',
                                 'meta_compare'  => '<',
                                 'meta_value'    => 6
                         ),
                         array(
                                 'meta_key'              => '_ibu',
                                 'meta_compare'  => '>',
                                 'meta_value'    => 50
                         ),
                 )
     ) );
 }}}

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


More information about the wp-trac mailing list