Restrict the media editor to posts with the attachment post type. Props helenyhou. fixes #20625
git-svn-id: http://core.svn.wordpress.org/trunk@20753 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1a5249997e
commit
df7e72511a
|
@ -59,6 +59,7 @@ case 'edit' :
|
||||||
$att = get_post($att_id);
|
$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 ( empty($att->ID) ) wp_die( __('You attempted to edit an attachment that doesn’t exist. Perhaps it was deleted?') );
|
||||||
|
if ( 'attachment' !== $att->post_type ) wp_die( __('You attempted to edit an item that isn’t an attachment. Please go back and try again.') );
|
||||||
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.') );
|
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);
|
add_filter('attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2);
|
||||||
|
|
Loading…
Reference in New Issue