Ticket #18708: 18708.2.patch
File 18708.2.patch, 2.4 KB (added by , 13 years ago) |
---|
-
wp-admin/includes/media.php
400 400 return "<a href='" . esc_url( get_upload_iframe_src($type) ) . "' id='{$id}-add_{$type}' class='thickbox add_$type' title='$title'><img src='" . esc_url( admin_url( $icon ) ) . "' alt='$title' onclick='return false;' /></a>"; 401 401 } 402 402 403 function get_upload_iframe_src($type ) {403 function get_upload_iframe_src($type, $close_on_save = false) { 404 404 global $post_ID, $temp_ID; 405 405 $uploading_iframe_ID = (int) (0 == $post_ID ? $temp_ID : $post_ID); 406 406 $upload_iframe_src = add_query_arg( 'post_id', $uploading_iframe_ID, admin_url('media-upload.php') ); 407 407 408 408 if ( 'media' != $type ) 409 409 $upload_iframe_src = add_query_arg('type', $type, $upload_iframe_src); 410 if ( $close_on_save ) 411 $upload_iframe_src = add_query_arg('close-on-save', true, $upload_iframe_src); 410 412 $upload_iframe_src = apply_filters($type . '_upload_iframe_src', $upload_iframe_src); 411 413 412 414 return add_query_arg('TB_iframe', true, $upload_iframe_src); -
wp-admin/includes/post.php
1186 1186 */ 1187 1187 function _wp_post_thumbnail_html( $thumbnail_id = NULL ) { 1188 1188 global $content_width, $_wp_additional_image_sizes, $post_ID; 1189 $set_thumbnail_link = '<p class="hide-if-no-js"><a title="' . esc_attr__( 'Set featured image' ) . '" href="' . esc_url( get_upload_iframe_src('image' ) ) . '" id="set-post-thumbnail" class="thickbox">%s</a></p>';1189 $set_thumbnail_link = '<p class="hide-if-no-js"><a title="' . esc_attr__( 'Set featured image' ) . '" href="' . esc_url( get_upload_iframe_src('image', true) ) . '" id="set-post-thumbnail" class="thickbox">%s</a></p>'; 1190 1190 $content = sprintf($set_thumbnail_link, esc_html__( 'Set featured image' )); 1191 1191 1192 1192 if ( $thumbnail_id && get_post( $thumbnail_id ) ) { -
wp-admin/js/set-post-thumbnail.dev.js
15 15 $link.fadeOut( 2000 ); 16 16 win.WPSetThumbnailID(id); 17 17 win.WPSetThumbnailHTML(str); 18 if ( window.location.href.indexOf('close-on-save') != -1 ) 19 win.tb_remove(); 18 20 } 19 21 } 20 22 );