﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
9124	"meta_compare needs to allow ""in"" as well"	Otto42	scribu	"In wp-includes/query.php:

{{{
if ( ! empty($q['meta_value']) ) {
if ( ! isset($q['meta_compare']) || empty($q['meta_compare']) || ! in_array($q['meta_compare'], array('=', '!=', '>', '>=', '<', '<=')) )
$q['meta_compare'] = '=';
}}}

This bit of code basically allows one to specify a meta_compare, in order to allow the meta_value to be something other than equal only. Greater than, less than, etc. However, it could be nice if it would also allow the word ""in"" to be used as it is used in SQL, thus resulting in a statement like this:

query(...meta_compare=in&meta_value=1,2,3...)

... AND meta_value in (1,2,3) ...

The ""in"" case would need to be added to that array, and special handling would be needed to add the parenths around the values in that case.
"	enhancement	closed	normal	3.1	Query	2.7	normal	fixed	gsoc has-patch	Denis-de-Bernardy wojtek.szkutnik@…
