WordPress.org

Make WordPress Core

Ticket #18708: 18708.patch

File 18708.patch, 2.6 KB (added by SergeyBiryukov, 7 years ago)
  • wp-admin/css/media.dev.css

     
    245245        text-align: center;
    246246}
    247247
    248 #media-upload a.wp-post-thumbnail {
    249         margin: 0 20px;
    250 }
    251 
    252248#media-items a.delete {
    253249        display: block;
    254250        float: right;
  • wp-admin/includes/media.php

     
    13301330                $calling_post_id = $post->post_parent;
    13311331        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 ) {
    13321332                $ajax_nonce = wp_create_nonce( "set_post_thumbnail-$calling_post_id" );
    1333                 $thumbnail = "<a class='wp-post-thumbnail' id='wp-post-thumbnail-" . $attachment_id . "' href='#' onclick='WPSetAsThumbnail(\"$attachment_id\", \"$ajax_nonce\");return false;'>" . esc_html__( "Use as featured image" ) . "</a>";
     1333                $thumbnail = "<input id='wp-post-thumbnail-" . $attachment_id . "' class='button' type='submit' onclick='WPSetAsThumbnail(\"$attachment_id\", \"$ajax_nonce\");return false;' value='" . esc_attr__( "Use as featured image" ) . "' name='wp-post-thumbnail-" . $attachment_id . "' />";
    13341334        }
    13351335
    13361336        if ( ( $send || $thumbnail || $delete ) && !isset( $form_fields['buttons'] ) )
  • wp-admin/js/set-post-thumbnail.dev.js

     
    11function WPSetAsThumbnail(id, nonce){
    2         var $link = jQuery('a#wp-post-thumbnail-' + id);
     2        var $button = jQuery('input#wp-post-thumbnail-' + id);
    33
    4         $link.text( setPostThumbnailL10n.saving );
     4        $button.val( setPostThumbnailL10n.saving );
    55        jQuery.post(ajaxurl, {
    66                action:"set-post-thumbnail", post_id: post_id, thumbnail_id: id, _ajax_nonce: nonce, cookie: encodeURIComponent(document.cookie)
    77        }, function(str){
    88                var win = window.dialogArguments || opener || parent || top;
    9                 $link.text( setPostThumbnailL10n.setThumbnail );
     9                $button.val( setPostThumbnailL10n.setThumbnail );
    1010                if ( str == '0' ) {
    1111                        alert( setPostThumbnailL10n.error );
    1212                } else {
    13                         jQuery('a.wp-post-thumbnail').show();
    14                         $link.text( setPostThumbnailL10n.done );
    15                         $link.fadeOut( 2000 );
     13                        $button.val( setPostThumbnailL10n.done );
     14                        $button.fadeOut( 2000 );
    1615                        win.WPSetThumbnailID(id);
    1716                        win.WPSetThumbnailHTML(str);
     17                        win.tb_remove();
    1818                }
    1919        }
    2020        );