From 56483060649af78658e78450e6e26e8486beed55 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Mon, 27 Feb 2012 19:23:03 +0000 Subject: [PATCH] Pass post id to get_upload_iframe_src() instead of relying on a global. Props tott. fixes #20003 git-svn-id: https://develop.svn.wordpress.org/trunk@19999 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/media.php | 7 +++++-- wp-admin/includes/post.php | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index 0ae2f100ed..a30076996b 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -392,10 +392,13 @@ function _media_button($title, $icon, $type, $id) { return "$title"; } -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 ) diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index 252b056e9a..d2f26a6cfd 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -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 = '

%s

'; + $set_thumbnail_link = '

%s

'; $content = sprintf($set_thumbnail_link, esc_html__( 'Set featured image' )); if ( $thumbnail_id && get_post( $thumbnail_id ) ) {