[wp-trac] [WordPress Trac] #17235: meta_query fails if you don't pass in an array of arrays

WordPress Trac wp-trac at lists.automattic.com
Mon Apr 25 22:02:50 UTC 2011


#17235: meta_query fails if you don't pass in an array of arrays
--------------------------+------------------------------
 Reporter:  batmoo        |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Query         |     Version:  3.1
 Severity:  normal        |  Resolution:
 Keywords:  close         |
--------------------------+------------------------------
Changes (by scribu):

 * keywords:   => close


Comment:

 Indeed, the meta_query will just be ignored.

 I think handling single arrays would create more confusion than solve,
 especially since you also have the old 'meta_key' and 'meta_value' query
 vars.

 What if a user does something like this:

 {{{
 $my_query = WP_Query( array
         array (
                 'post_type' => 'post',
                 'meta_query' => array (
                         'key' => 'foo',
                         'value => 'some_val',
                         array(
                                 'key' => 'bar',
                                 'value' => 'another_val',
                         )
                 ),
         ),
 );
 }}}

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


More information about the wp-trac mailing list