From 26b8bb3800a3af821c58adbb254e87bb43bf4815 Mon Sep 17 00:00:00 2001 From: Ryan Boren 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: https://develop.svn.wordpress.org/trunk@7651 602fd350-edb4-49c9-b593-d223f7449a82 --- 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");