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
This commit is contained in:
parent
d943a8252a
commit
030a8b9b33
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue