diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php
index e7b4c10369..57df2bcbff 100644
--- a/wp-admin/includes/media.php
+++ b/wp-admin/includes/media.php
@@ -527,12 +527,14 @@ function media_handle_sideload( $file_array, $post_id = 0, $desc = null, $post_d
* @since 5.3.0 Formalized the existing and already documented `...$args` parameter
* by adding it to the function signature.
*
- * @global int $body_id
+ * @global string $body_id
*
* @param callable $content_func Function that outputs the content.
* @param mixed ...$args Optional additional parameters to pass to the callback function when it's called.
*/
function wp_iframe( $content_func, ...$args ) {
+ global $body_id;
+
_wp_admin_html_begin();
?>
› —
@@ -603,8 +605,8 @@ function wp_iframe( $content_func, ...$args ) {
$body_id_attr = '';
- if ( isset( $GLOBALS['body_id'] ) ) {
- $body_id_attr = ' id="' . $GLOBALS['body_id'] . '"';
+ if ( isset( $body_id ) ) {
+ $body_id_attr = ' id="' . $body_id . '"';
}
?>
diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php
index 6b4a50752e..90b375e882 100644
--- a/wp-admin/includes/template.php
+++ b/wp-admin/includes/template.php
@@ -2118,14 +2118,17 @@ function _admin_search_query() {
*
* @global string $hook_suffix
* @global string $admin_body_class
+ * @global string $body_id
* @global WP_Locale $wp_locale WordPress date and time locale object.
*
* @param string $title Optional. Title of the Iframe page. Default empty.
* @param bool $deprecated Not used.
*/
function iframe_header( $title = '', $deprecated = false ) {
+ global $hook_suffix, $admin_body_class, $body_id, $wp_locale;
+
show_admin_bar( false );
- global $hook_suffix, $admin_body_class, $wp_locale;
+
$admin_body_class = preg_replace( '/[^a-z0-9_-]+/i', '-', $hook_suffix );
$current_screen = get_current_screen();
@@ -2179,10 +2182,7 @@ var ajaxurl = '