X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/d3b1ea255664edd2deef17f900a655613d20820d..3f5685912e89eb3b0534acd85aa0946b1ca2bbe3:/wp-admin/media.php?ds=sidebyside diff --git a/wp-admin/media.php b/wp-admin/media.php index e31baf2d..09776b48 100644 --- a/wp-admin/media.php +++ b/wp-admin/media.php @@ -58,9 +58,14 @@ case 'edit' : $att = get_post($att_id); + if ( empty($att->ID) ) wp_die( __('You attempted to edit an attachment that doesn’t exist. Perhaps it was deleted?') ); + if ( $att->post_status == 'trash' ) wp_die( __('You can’t edit this attachment because it is in the Trash. Please move it out of the Trash and try again.') ); + add_filter('attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2); wp_enqueue_script( 'wp-ajax-response' ); + wp_enqueue_script('image-edit'); + wp_enqueue_style('imgareaselect'); require( 'admin-header.php' );