From 030a8b9b332230855713daed926fd7812f858045 Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 14 Apr 2008 16:30:27 +0000 Subject: [PATCH] Fix image fetching in get_media_items(). Props tellyworth. fixes #6657 for trunk git-svn-id: http://svn.automattic.com/wordpress/trunk@7651 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/media.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index 8c8049fbb2..5ac073717c 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -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");