From 11c5f2c1fc85efae79bb0946bc5f283768d0fadb Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 27 Nov 2012 15:06:02 +0000 Subject: [PATCH] Only show the image edit button for image attachments. Props markoheijnen. fixes #22596 git-svn-id: http://core.svn.wordpress.org/trunk@22867 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/media.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index 09e5d81e6c..e3a912ac81 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -1132,7 +1132,7 @@ function get_media_item( $attachment_id, $args = null ) { $media_dims = apply_filters( 'media_meta', $media_dims, $post ); $image_edit_button = ''; - if ( wp_image_editor_supports( array( 'mime_type' => $post->post_mime_type ) ) ) { + if ( wp_attachment_is_image( $post->ID ) && wp_image_editor_supports( array( 'mime_type' => $post->post_mime_type ) ) ) { $nonce = wp_create_nonce( "image_editor-$post->ID" ); $image_edit_button = " "; } @@ -2270,7 +2270,7 @@ function edit_form_image_editor() { $att_url = wp_get_attachment_url( $post->ID ); $image_edit_button = ''; - if ( wp_image_editor_supports( array( 'mime_type' => $post->post_mime_type ) ) ) { + if ( wp_attachment_is_image( $post->ID ) && wp_image_editor_supports( array( 'mime_type' => $post->post_mime_type ) ) ) { $nonce = wp_create_nonce( "image_editor-$post->ID" ); $image_edit_button = " "; }