[wp-trac] [WordPress Trac] #35930: Search in meta posts
WordPress Trac
noreply at wordpress.org
Wed Feb 24 08:05:34 UTC 2016
#35930: Search in meta posts
------------------------------+----------------------
Reporter: sebastian.pisula | Owner:
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: Query | Version:
Severity: normal | Resolution: invalid
Keywords: | Focuses:
------------------------------+----------------------
Changes (by swissspidy):
* keywords: needs-patch 2nd-opinion =>
* status: new => closed
* resolution: => invalid
* milestone: Awaiting Review =>
Comment:
The default relation of a meta query defaults to `AND`, but you can change
it to `OR` like this:
{{{#!php
array(
'relation' => 'OR', // Optional, defaults to "AND"
array(
'key' => '_my_custom_key',
'value' => 'Value I am looking for',
'compare' => '='
)
);
}}}
See https://codex.wordpress.org/Class_Reference/WP_Meta_Query for more
examples.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35930#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list