mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-30 20:21:37 +01:00
Pass post id to get_upload_iframe_src() instead of relying on a global. Props tott. fixes #20003
git-svn-id: http://svn.automattic.com/wordpress/trunk@19999 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b4a66348d4
commit
e4ce1046b0
@ -392,10 +392,13 @@ function _media_button($title, $icon, $type, $id) {
|
||||
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>";
|
||||
}
|
||||
|
||||
function get_upload_iframe_src( $type = null ) {
|
||||
function get_upload_iframe_src( $type = null, $post_id = null ) {
|
||||
global $post_ID;
|
||||
|
||||
$uploading_iframe_ID = (int) $post_ID;
|
||||
if ( empty( $post_id ) )
|
||||
$post_id = $post_ID;
|
||||
|
||||
$uploading_iframe_ID = (int) $post_id;
|
||||
$upload_iframe_src = add_query_arg( 'post_id', $uploading_iframe_ID, admin_url('media-upload.php') );
|
||||
|
||||
if ( $type && 'media' != $type )
|
||||
|
@ -1152,7 +1152,7 @@ function _wp_post_thumbnail_html( $thumbnail_id = null, $post_id = null ) {
|
||||
if ( empty( $post_id ) )
|
||||
$post_id = $post_ID;
|
||||
|
||||
$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>';
|
||||
$set_thumbnail_link = '<p class="hide-if-no-js"><a title="' . esc_attr__( 'Set featured image' ) . '" href="' . esc_url( get_upload_iframe_src('image', $post_id) ) . '" id="set-post-thumbnail" class="thickbox">%s</a></p>';
|
||||
$content = sprintf($set_thumbnail_link, esc_html__( 'Set featured image' ));
|
||||
|
||||
if ( $thumbnail_id && get_post( $thumbnail_id ) ) {
|
||||
|
Loading…
Reference in New Issue
Block a user