$attachments[ $attachment->ID
] =
$attachment;
} } } $output = '';
foreach ( (array) $attachments as $id =>
$attachment ) { if ( 'trash' ===
$attachment->post_status
) { continue;
} $item =
get_media_item( $id, array
( 'errors' =>
isset( $errors[ $id ] ) ?
$errors[ $id ] : null
) );
if ( $item ) { $output .= "\n<div id='media-item-
$id' class='media-item child-of-
$attachment->post_parent preloaded'><div class='progress hidden'><div class='bar'></div></div><div id='media-upload-error-
$id' class='hidden'></div><div class='filename hidden'></div>
$item\n</div>";
} } return $output;
}/**
* Retrieves HTML form for modifying the image attachment.
*
* @since 2.5.0
*
* @global string $redir_tab
*
* @param int $attachment_id Attachment ID for modification.
* @param string|array $args Optional. Override defaults.
* @return string HTML form for attachment.
*/