﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
15292	"It's not possible to check for ""meta_value = 0"" in wp_query->get_posts"	hetjens	scribu	"Because of the ""empty"" function of php it isn't possible to check for a meta_value = 0 in wp_query->get_posts.

My Case:

{{{
'meta_key' => '_menu_item_menu_item_parent',
'meta_value' => '0',
}}}

wp-includes/query.php Line 2307 is:
{{{if ( ! empty($q['meta_value']) ) {}}}

But empty() says that String ""0"" is true

So the query will return all posts that have a meta-field ""_menu_item_menu_item_parent"" and not only the posts with ""_menu_item_menu_item_parent = 0"" (which means, that it's an menu root item)

My solution is:

{{{
if (( ! empty($q['meta_value']) ) || ($q['meta_value'] == '0')) {
}}}

but that's not very nice. Any better idea?

Thanks,
Philip"	defect (bug)	closed	normal	3.2	Query	3.0.1	major	fixed	has-patch commit	
