From d3f3b6bed148964dd8f1f925bc297c9525b39a41 Mon Sep 17 00:00:00 2001 From: markjaquith Date: Mon, 19 Oct 2009 16:36:21 +0000 Subject: [PATCH] Only show Use for thumbnail link for image attachments. see #10928 git-svn-id: http://svn.automattic.com/wordpress/trunk@12059 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/media.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index c4970b07d..7b14d6cdb 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -1151,7 +1151,7 @@ function get_media_item( $attachment_id, $args = null ) { if ( isset($post_mime_types) ) { $keys = array_keys(wp_match_mime_types(array_keys($post_mime_types), $post->post_mime_type)); $type = array_shift($keys); - $type = ""; + $type_html = ""; } $form_fields = get_attachment_fields_to_edit($post, $errors); @@ -1160,8 +1160,9 @@ function get_media_item( $attachment_id, $args = null ) { $class = empty($errors) ? 'startclosed' : 'startopen'; $toggle_links = " $toggle_on - $toggle_off - " . esc_html__( "Use for thumbnail" ) . ""; + $toggle_off"; + if ( 'image' == $type ) + $toggle_links .= "" . esc_html__( "Use for thumbnail" ) . ""; } else { $class = 'form-table'; $toggle_links = ''; @@ -1197,7 +1198,7 @@ function get_media_item( $attachment_id, $args = null ) { } $item = " - $type + $type_html $toggle_links $order $display_title