[wp-trac] [WordPress Trac] #17235: meta_query fails if you don't pass in an array of arrays
WordPress Trac
noreply at wordpress.org
Thu May 29 04:57:24 UTC 2014
#17235: meta_query fails if you don't pass in an array of arrays
----------------------------------+----------------------
Reporter: batmoo | Owner:
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: Query | Version: 3.1
Severity: normal | Resolution: wontfix
Keywords: has-patch meta-query | Focuses:
----------------------------------+----------------------
Changes (by wonderboymusic):
* status: new => closed
* resolution: => wontfix
* milestone: Future Release =>
Comment:
I have evolved on this: we shouldn't do it.
The use-case for not having an array of arrays is performing a meta query
with only one set of conditions. That can be accomplished by using the
top-level meta-related query vars. If you need more control, pass an array
of arrays, even if it is only one.
Meta queries should be rare as is - if you are going to go to the trouble
of using them, learn how they are constructed. Dropping the outer array
requirement is barely a convenience.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/17235#comment:17>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list