WordPress.org

Make WordPress Core

Ticket #18708: 18708.3.patch

File 18708.3.patch, 2.2 KB (added by SergeyBiryukov, 2 years ago)
  • wp-admin/includes/media.php

     
    390390        return "<a href='" . esc_url( get_upload_iframe_src($type) ) . "' id='{$id}-add_{$type}' class='thickbox add_$type' title='" . esc_attr( $title ) . "'><img src='" . esc_url( admin_url( $icon ) ) . "' alt='$title' onclick='return false;' /></a>"; 
    391391} 
    392392 
    393 function get_upload_iframe_src( $type = null, $post_id = null, $tab = null ) { 
     393function get_upload_iframe_src( $type = null, $post_id = null, $tab = null, $context = 'post' ) { 
    394394        global $post_ID; 
    395395 
    396396        if ( empty( $post_id ) ) 
     
    404404        if ( ! empty( $tab ) ) 
    405405                $upload_iframe_src = add_query_arg('tab', $tab, $upload_iframe_src); 
    406406 
     407        if ( 'post' != $context ) 
     408                $upload_iframe_src = add_query_arg('context', $context, $upload_iframe_src); 
     409 
    407410        $upload_iframe_src = apply_filters($type . '_upload_iframe_src', $upload_iframe_src); 
    408411 
    409412        return add_query_arg('TB_iframe', true, $upload_iframe_src); 
  • wp-admin/includes/post.php

     
    11451145        if ( empty( $post_id ) ) 
    11461146                $post_id = $post_ID; 
    11471147 
    1148         $upload_iframe_src = esc_url( get_upload_iframe_src('image', $post_id) ); 
     1148        $upload_iframe_src = esc_url( get_upload_iframe_src( 'image', $post_id, null, 'featured' ) ); 
    11491149        $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>'; 
    11501150        $content = sprintf( $set_thumbnail_link, $upload_iframe_src, esc_html__( 'Set featured image' ) ); 
    11511151 
  • wp-admin/js/set-post-thumbnail.dev.js

     
    1515                        $link.fadeOut( 2000 ); 
    1616                        win.WPSetThumbnailID(id); 
    1717                        win.WPSetThumbnailHTML(str); 
     18                        if ( window.location.href.indexOf('featured') != -1 ) 
     19                                win.tb_remove(); 
    1820                } 
    1921        } 
    2022        );