﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc	focuses	prnumber
48382	do_action convert array of post to single post object if array contain only 1 post	fabienlege		"in wp-includes/plugin.php line 456, function do_action automaticaly convert array of one post to single post object.

code to reproduce bug :
{{{#!php
<?php
$posts = get_post($args); // this return an array on 0,1 or more wp_post objects.
do_action('test',$posts);
add_action('test',function($posts){
    var_dump($posts); // if $posts is empty array, we have an empty array. if its an array of multiple posts, we have an array of multiple posts. but, if an array of one post is passed to parameter, we have a single wp_post object (not in an array).
})
}}}


It's a real problem if you need to do action on get_posts result. you don't know if the result is 0, 1 or more post and, forexemple, a foreach fail
"	defect (bug)	closed	normal		Plugins	trunk	normal	duplicate				
