From 822f6e6746505304185efd5ddc0269a8a7047b08 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Fri, 20 Sep 2013 20:12:11 +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. git-svn-id: https://develop.svn.wordpress.org/trunk@25525 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/meta.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/meta.php b/src/wp-includes/meta.php index bec41eec32..53343e0acd 100644 --- a/src/wp-includes/meta.php +++ b/src/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 = '=';