Docs: Consistently document the `$body_id` global as a string.

Includes declaring the global at the beginning of `wp_iframe()` and `iframe_header()`.

Follow-up to [32642], [32643].

Props mukesh27, upadalavipul.
Fixes #60032.
Built from https://develop.svn.wordpress.org/trunk@57181


git-svn-id: http://core.svn.wordpress.org/trunk@56692 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2023-12-11 12:11:22 +00:00
parent fb4428dd60
commit a2bcc36278
3 changed files with 11 additions and 9 deletions

View File

@ -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();
?>
<title><?php bloginfo( 'name' ); ?> &rsaquo; <?php _e( 'Uploads' ); ?> &#8212; <?php _e( 'WordPress' ); ?></title>
@ -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 . '"';
}
?>

View File

@ -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 = '<?php echo esc_js( admin_url( 'admin-ajax.php', 'relative' ) ); ?
?>
</head>
<?php
/**
* @global string $body_id
*/
$admin_body_id = isset( $GLOBALS['body_id'] ) ? 'id="' . $GLOBALS['body_id'] . '" ' : '';
$admin_body_id = isset( $body_id ) ? 'id="' . $body_id . '" ' : '';
/** This filter is documented in wp-admin/admin-header.php */
$admin_body_classes = apply_filters( 'admin_body_class', '' );

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.5-alpha-57180';
$wp_version = '6.5-alpha-57181';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.