#23294 closed defect (bug) (duplicate)
Using "OR" in 'meta_query' negates the "NOT EXISTS" compare.
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Query | Keywords: | |
Focuses: | Cc: |
Description
When using the "NOT EXISTS" compare within 'meta_query' to look for undefined custom fields if I also add in a secondary 'OR' query, the entire query behaves as if I was just checking for "EXISTS". The following code:
'meta_query' => array( 'relation' => 'OR', array( 'key' => 'status', 'compare' => 'NOT EXISTS', ), array( 'key' => 'status', 'value' => 'new', 'compare' => '=', ), );
will return any post that has a value set for the "status" custom field.
Change History (3)
Note: See
TracTickets for help on using
tickets.
Duplicate of #23268.