WordPress.org

Make WordPress Core

Ticket #19396: 19396.patch

File 19396.patch, 1.3 KB (added by SergeyBiryukov, 22 months ago)
  • wp-admin/includes/media.php

     
    2121                'library' => __('Media Library') 
    2222        ); 
    2323 
     24        if ( isset( $_REQUEST['context'] ) && $_REQUEST['context'] == 'featured' ) 
     25                unset( $_default_tabs['type_url'] ); 
     26 
    2427        return apply_filters('media_upload_tabs', $_default_tabs); 
    2528} 
    2629 
  • wp-admin/includes/post.php

     
    11471147        if ( empty( $post_id ) ) 
    11481148                $post_id = $post_ID; 
    11491149 
    1150         $upload_iframe_src = esc_url( get_upload_iframe_src('image', $post_id) ); 
     1150        $upload_iframe_src = get_upload_iframe_src( 'image', $post_id ); 
     1151        $upload_iframe_src = remove_query_arg( 'TB_iframe', $upload_iframe_src ); 
     1152        $upload_iframe_src = esc_url( add_query_arg( array( 'context' => 'featured', 'TB_iframe' => 1 ), $upload_iframe_src ) ); 
    11511153        $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>'; 
    11521154        $content = sprintf( $set_thumbnail_link, $upload_iframe_src, esc_html__( 'Set featured image' ) ); 
    11531155