Ticket #18708: 18708.4.patch
File 18708.4.patch, 3.7 KB (added by , 12 years ago) |
---|
-
wp-admin/css/media.dev.css
193 193 text-align: center; 194 194 } 195 195 196 #media-upload a.wp-post-thumbnail {197 margin: 0 20px;198 }199 200 196 #media-items a.delete { 201 197 display: block; 202 198 float: right; -
wp-admin/includes/media.php
1180 1180 if ( 'image' == $type && $calling_post_id && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) ) 1181 1181 && post_type_supports( get_post_type( $calling_post_id ), 'thumbnail' ) && get_post_thumbnail_id( $calling_post_id ) != $attachment_id ) { 1182 1182 $ajax_nonce = wp_create_nonce( "set_post_thumbnail-$calling_post_id" ); 1183 $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>";1183 $thumbnail = "<input class='wp-post-thumbnail' 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 . "' />"; 1184 1184 } 1185 1185 1186 1186 if ( ( $send || $thumbnail || $delete ) && !isset( $form_fields['buttons'] ) ) -
wp-admin/includes/post.php
1145 1145 if ( empty( $post_id ) ) 1146 1146 $post_id = $post_ID; 1147 1147 1148 $upload_iframe_src = esc_url( get_upload_iframe_src('image', $post_id) ); 1148 $upload_iframe_src = get_upload_iframe_src( 'image', $post_id ); 1149 $upload_iframe_src = remove_query_arg( 'TB_iframe', $upload_iframe_src ); 1150 $upload_iframe_src = add_query_arg( array( 'context' => 'featured', 'TB_iframe' => 1 ), $upload_iframe_src ); 1149 1151 $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 1152 $content = sprintf( $set_thumbnail_link, $upload_iframe_src, esc_html__( 'Set featured image' ) ); 1151 1153 -
wp-admin/js/set-post-thumbnail.dev.js
1 1 function WPSetAsThumbnail(id, nonce){ 2 var $ link = jQuery('a#wp-post-thumbnail-' + id);2 var $button = jQuery('input#wp-post-thumbnail-' + id); 3 3 4 $ link.text( setPostThumbnailL10n.saving );4 $button.val( setPostThumbnailL10n.saving ); 5 5 jQuery.post(ajaxurl, { 6 6 action:"set-post-thumbnail", post_id: post_id, thumbnail_id: id, _ajax_nonce: nonce, cookie: encodeURIComponent(document.cookie) 7 7 }, function(str){ 8 8 var win = window.dialogArguments || opener || parent || top; 9 $ link.text( setPostThumbnailL10n.setThumbnail );9 $button.val( setPostThumbnailL10n.setThumbnail ); 10 10 if ( str == '0' ) { 11 11 alert( setPostThumbnailL10n.error ); 12 12 } else { 13 jQuery(' a.wp-post-thumbnail').show();14 $ link.text( setPostThumbnailL10n.done );15 $ link.fadeOut( 2000 );13 jQuery('input.wp-post-thumbnail').show(); 14 $button.val( setPostThumbnailL10n.done ); 15 $button.fadeOut( 2000 ); 16 16 win.WPSetThumbnailID(id); 17 17 win.WPSetThumbnailHTML(str); 18 if ( window.location.href.indexOf('featured') != -1 ) 19 win.tb_remove(); 18 20 } 19 21 } 20 22 );