Provide visual feedback for "Use as thumbnail" when clicked immediately after uploading the image. fixes #11140

git-svn-id: https://develop.svn.wordpress.org/trunk@12355 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith
2009-12-10 08:03:26 +00:00
parent 400915e28a
commit db7d45ebe2
4 changed files with 4 additions and 4 deletions

View File

@@ -1245,7 +1245,7 @@ function get_media_item( $attachment_id, $args = null ) {
elseif ( isset( $_POST ) && count( $_POST ) ) // Like for async-upload where $_GET['post_id'] isn't set
$calling_post_id = $post->post_parent;
if ( 'image' == $type && $calling_post_id && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) ) && get_post_thumbnail_id( $calling_post_id ) != $attachment_id )
$thumbnail = "<a class='wp-post-thumbnail' href='#' onclick='WPSetAsThumbnail(\"$attachment_id\");return false;'>" . esc_html__( "Use as thumbnail" ) . "</a>";
$thumbnail = "<a class='wp-post-thumbnail' id='wp-post-thumbnail-" . $attachment_id . "' href='#' onclick='WPSetAsThumbnail(\"$attachment_id\");return false;'>" . esc_html__( "Use as thumbnail" ) . "</a>";
if ( ( $send || $thumbnail || $delete ) && !isset($form_fields['buttons']) )
$form_fields['buttons'] = array('tr' => "\t\t<tr class='submit'><td></td><td class='savesend'>$send $thumbnail $delete</td></tr>\n");