﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
17014	Passing post_status an array for a new WP_Query throws an error	drebabels		"According to the WP_Query documentation (http://codex.wordpress.org/Function_Reference/WP_Query#Type_.26_Status_Parameters) the post_status parameter takes either an array or string. However when you pass it an array like so

{{{
$args = array (
	'post_status' => array('inherit','publish')
);
$query = new WP_Query( $args );
}}}

The following two errors are thrown:

Warning: explode() expects parameter 2 to be string, array given in /Users/ender/Sites/soompi3k_trunk/htdocs/wp-includes/query.php on line 2369

Warning: in_array() expects parameter 2 to be array, null given in /Users/ender/Sites/soompi3k_trunk/htdocs/wp-includes/query.php on line 2378

And the SQL query looks like this:

SELECT SQL_CALC_FOUND_ROWS  wp_posts.* FROM wp_posts  WHERE 1=1  AND wp_posts.post_type = 'post'  ORDER BY wp_posts.post_date DESC LIMIT 0, 10

But pass in a comma separated string like so

{{{
$args = array (
	'post_status' => 'inherit, publish'
);
$query = new WP_Query( $args );
}}}

No errors are thrown and the resulting SQL query is what I would expect:

SELECT SQL_CALC_FOUND_ROWS  wp_posts.* FROM wp_posts  WHERE 1=1  AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'inherit')  ORDER BY wp_posts.post_date DESC LIMIT 0, 10



"	defect (bug)	closed	normal		Query		minor	duplicate		
