From d814ad50b33d352380bfc0a484332cbed89123dc Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Fri, 20 Sep 2013 20:13:09 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@25525 git-svn-id: http://core.svn.wordpress.org/trunk@25445 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/meta.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-includes/meta.php b/wp-includes/meta.php index bec41eec32..53343e0acd 100644 --- a/wp-includes/meta.php +++ b/wp-includes/meta.php @@ -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 = '=';