WordPress.org

Make WordPress Core

Ticket #20443: 20443.diff

File 20443.diff, 1.6 KB (added by rosshanney, 7 years ago)
  • wp-admin/includes/post.php

     
    11451145        if ( empty( $post_id ) )
    11461146                $post_id = $post_ID;
    11471147
    1148         $set_thumbnail_link = '<p class="hide-if-no-js"><a title="' . esc_attr__( 'Set featured image' ) . '" href="' . esc_url( get_upload_iframe_src('image', $post_id) ) . '" id="set-post-thumbnail" class="thickbox">%s</a></p>';
    1149         $content = sprintf($set_thumbnail_link, esc_html__( 'Set featured image' ));
     1148        $upload_iframe_src = esc_url( get_upload_iframe_src('image', $post_id) );
     1149        $set_thumbnail_link = '<p class="hide-if-no-js"><a title="' . esc_attr__( 'Set featured image' ) . '" href="%s" id="set-post-thumbnail" class="thickbox">%s</a></p>';
     1150        $content = sprintf( $set_thumbnail_link, $upload_iframe_src, esc_html__( 'Set featured image' ) );
    11501151
    11511152        if ( $thumbnail_id && get_post( $thumbnail_id ) ) {
    11521153                $old_content_width = $content_width;
     
    11571158                        $thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'post-thumbnail' );
    11581159                if ( !empty( $thumbnail_html ) ) {
    11591160                        $ajax_nonce = wp_create_nonce( "set_post_thumbnail-$post_id" );
    1160                         $content = sprintf($set_thumbnail_link, $thumbnail_html);
     1161                        $content = sprintf( $set_thumbnail_link, $upload_iframe_src, $thumbnail_html );
    11611162                        $content .= '<p class="hide-if-no-js"><a href="#" id="remove-post-thumbnail" onclick="WPRemoveThumbnail(\'' . $ajax_nonce . '\');return false;">' . esc_html__( 'Remove featured image' ) . '</a></p>';
    11621163                }
    11631164                $content_width = $old_content_width;