WordPress.org

Make WordPress Core

Ticket #11366: 11366.2.diff

File 11366.2.diff, 1.1 KB (added by nacin, 4 years ago)
  • media.php

     
    12391239        } 
    12401240 
    12411241        $thumbnail = ''; 
    1242         if ( 'image' == $type && current_theme_supports( 'post-images' ) && get_post_image_id($_GET['post_id']) != $attachment_id ) 
    1243                 $thumbnail = "<a class='wp-post-thumbnail' href='#' onclick='WPSetAsThumbnail(\"$attachment_id\");return false;'>" . esc_html__( "Use as thumbnail" ) . "</a>"; 
     1242        if ( 'image' == $type && current_theme_supports( 'post-images' ) && isset( $_GET['post_id'] ) && get_post_image_id($_GET['post_id']) != $attachment_id ) { 
     1243                if ( 'page' == get_post_type( $_GET['post_id'] ) ) 
     1244                        $thumbnail = __( "Use as page image" ); 
     1245                else 
     1246                        $thumbnail = __( "Use as post image" ); 
     1247                $thumbnail = "<a class='wp-post-thumbnail' href='#' onclick='WPSetAsThumbnail(\"$attachment_id\");return false;'>" . esc_html( $thumbnail ) . "</a>"; 
     1248        } 
    12441249 
    12451250        if ( ( $send || $thumbnail || $delete ) && !isset($form_fields['buttons']) ) 
    12461251                $form_fields['buttons'] = array('tr' => "\t\t<tr class='submit'><td></td><td class='savesend'>$send $thumbnail $delete</td></tr>\n");