[wp-trac] [WordPress Trac] #24576: Make WP_Meta_Query accept arrays for keys

WordPress Trac noreply at wordpress.org
Tue Oct 14 03:35:02 UTC 2014


#24576: Make WP_Meta_Query accept arrays for keys
-------------------------------------------------+-------------------------
 Reporter:  Viper007Bond                         |       Owner:
     Type:  enhancement                          |      Status:  closed
 Priority:  lowest                               |   Milestone:
Component:  Query                                |     Version:  3.5.1
 Severity:  trivial                              |  Resolution:  wontfix
 Keywords:  needs-patch meta-query needs-unit-   |     Focuses:
  tests                                          |
-------------------------------------------------+-------------------------
Changes (by boonebgorges):

 * status:  new => closed
 * resolution:   => wontfix
 * milestone:  Future Release =>


Comment:

 I don't think this is necessary anymore now that you can nest queries
 [29887]. `( key1 = abc OR key2 = abc ) AND key3 = def` becomes:

 {{{
 array(
     'relation' => 'AND',
     array(
         'relation' => 'OR',
         array(
             'key' => 'key1',
             'value' => 'abc',
         ),
         array(
             'key' => 'key2',
             'value' => 'abc',
         ),
     ),
     array(
         'key' => 'key3',
         'value' => 'def',
     ),
 )
 }}}

 A little more verbose than what Viper007Bond originally suggested, but it
 has the virtue of being unambiguous: we don't have to decide whether the
 array of keys should be interpreted with AND or OR logic.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/24576#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list