Fix image fetching in get_media_items(). Props tellyworth. fixes #6657 for trunk

git-svn-id: https://develop.svn.wordpress.org/trunk@7651 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-04-14 16:30:27 +00:00
parent d12d1c803b
commit 26b8bb3800

View File

@ -590,8 +590,9 @@ function get_attachment_fields_to_edit($post, $errors = null) {
}
function get_media_items( $post_id, $errors ) {
if ( $post_id && $post = get_post($post_id) ) {
if ( $post->post_type == 'attachment' )
if ( $post_id ) {
$post = get_post($post_id);
if ( $post && $post->post_type == 'attachment' )
$attachments = array($post->ID => $post);
else
$attachments = get_children("post_parent=$post_id&post_type=attachment&orderby=menu_order ASC, ID&order=DESC");