mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-11 02:49:04 +01:00
Do not show "Use as thumbnail" in standalone media browser, but DO show it when you upload a new image on a post. fixes #11366
git-svn-id: http://svn.automattic.com/wordpress/trunk@12352 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
bf264bb66d
commit
8a3607998c
@ -1239,7 +1239,12 @@ function get_media_item( $attachment_id, $args = null ) {
|
||||
}
|
||||
|
||||
$thumbnail = '';
|
||||
if ( 'image' == $type && isset($_GET['post_id']) && current_theme_supports( 'post-thumbnails', get_post_type($_GET['post_id']) ) && get_post_thumbnail_id($_GET['post_id']) != $attachment_id )
|
||||
$calling_post_id = 0;
|
||||
if ( isset( $_GET['post_id'] ) )
|
||||
$calling_post_id = $_GET['post_id'];
|
||||
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>";
|
||||
|
||||
if ( ( $send || $thumbnail || $delete ) && !isset($form_fields['buttons']) )
|
||||
|
Loading…
Reference in New Issue
Block a user