[wp-trac] [WordPress Trac] #21683: Choose the relationship between the meta_query and what it's pulled into (AND/OR)
WordPress Trac
wp-trac at lists.automattic.com
Mon Aug 27 14:12:43 UTC 2012
#21683: Choose the relationship between the meta_query and what it's pulled into
(AND/OR)
-------------------------------------------------+-------------------------
Reporter: sc0ttkclark | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting
Component: Query | Review
Severity: normal | Version: 3.4.1
Keywords: dev-feedback has-patch reporter- | Resolution:
feedback |
-------------------------------------------------+-------------------------
Comment (by sc0ttkclark):
Actually you are correct @johnbillion, I was working on this solution for
a friend who needed it to do as was explained, however there are flaws in
it that make it more of an edge case. One main attraction to this is that
even though it operates as you said - main arguments OR meta query match -
it runs (sans filters) as the last of the 'where' clauses built out, so
it's use isn't negated from what I explained above.
Here's an example:
{{{
$my_query = WP_Query( array(
'post_type' => 'any',
'cat' => 4,
'meta_query' => array(
'query_relation' => 'OR',
array(
'key' => 'super_post',
'value' => 1
)
)
) );
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/21683#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list