Add REGEXP to meta queries.

"REGEXP is usually a terrible idea to use, but I see no reason to disallow it."

props wonderboymusic.
fixes #18736.


git-svn-id: https://develop.svn.wordpress.org/trunk@25525 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-09-20 20:12:11 +00:00
parent a213611e4e
commit 822f6e6746
1 changed files with 4 additions and 2 deletions

View File

@ -614,7 +614,8 @@ class WP_Meta_Query {
* - 'key' string The meta key
* - 'value' string|array The meta value
* - 'compare' (optional) string How to compare the key to the value.
* Possible values: '=', '!=', '>', '>=', '<', '<=', 'LIKE', 'NOT LIKE', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN'.
* Possible values: '=', '!=', '>', '>=', '<', '<=', 'LIKE', 'NOT LIKE', 'IN', 'NOT IN',
* 'BETWEEN', 'NOT BETWEEN', 'REGEXP', 'NOT REGEXP', 'RLIKE'.
* Default: '='
* - 'type' string (optional) The type of the value.
* Possible values: 'NUMERIC', 'BINARY', 'CHAR', 'DATE', 'DATETIME', 'DECIMAL', 'SIGNED', 'TIME', 'UNSIGNED'.
@ -781,7 +782,8 @@ class WP_Meta_Query {
'LIKE', 'NOT LIKE',
'IN', 'NOT IN',
'BETWEEN', 'NOT BETWEEN',
'NOT EXISTS'
'NOT EXISTS',
'REGEXP', 'NOT REGEXP', 'RLIKE'
) ) )
$meta_compare = '=';