mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-17 20:15:08 +00:00
In WP_Meta_Query
, interpret 'value' correctly when used with EXISTS/NOT EXISTS.
As in earlier versions, EXISTS with a value is equivalent to '=', while NOT EXISTS should always ignore 'value'. Merges [30846] to the 4.1 branch. Props barrykooij. Fixes #30681 Built from https://develop.svn.wordpress.org/branches/4.1@30848 git-svn-id: http://core.svn.wordpress.org/branches/4.1@30838 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
deec4ec7ee
commit
2fc06d04c5
@ -1419,6 +1419,17 @@ class WP_Meta_Query {
|
||||
$where = $wpdb->prepare( '%s', $meta_value );
|
||||
break;
|
||||
|
||||
// EXISTS with a value is interpreted as '='.
|
||||
case 'EXISTS' :
|
||||
$meta_compare = '=';
|
||||
$where = $wpdb->prepare( '%s', $meta_value );
|
||||
break;
|
||||
|
||||
// 'value' is ignored for NOT EXISTS.
|
||||
case 'NOT EXISTS' :
|
||||
$where = '';
|
||||
break;
|
||||
|
||||
default :
|
||||
$where = $wpdb->prepare( '%s', $meta_value );
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user