wp_iframe( callable $content_func, mixed $args )
- Since
- 2.5.0, 5.3.0
- Source
wp-admin/includes/media.php:553
Parameters
$content_funccallable- Function that outputs the content.
$argsmixed- Optional additional parameters to pass to the callback function when it's called.
Hooks fired · 9
9 hooks fire while wp_iframe() runs, in this order:
- do_action( admin_enqueue_scripts )actionline 578 (+25 into the body)
Fires when enqueuing scripts for all admin pages.
- do_action( admin_print_styles-media-upload-popup )actionline 585 (+32 into the body)
Fires when admin styles enqueued for the legacy (pre-3.5.0) media upload popup are printed.
- do_action( admin_print_styles )actionline 588 (+35 into the body)
Fires when styles are printed for all admin pages.
- do_action( admin_print_scripts-media-upload-popup )actionline 595 (+42 into the body)
Fires when admin scripts enqueued for the legacy (pre-3.5.0) media upload popup are printed.
- do_action( admin_print_scripts )actionline 598 (+45 into the body)
Fires when scripts are printed for all admin pages.
- do_action( admin_head-media-upload-popup )actionline 606 (+53 into the body)
Fires when scripts enqueued for the admin header for the legacy (pre-3.5.0) media upload popup are printed.
- do_action( admin_head_{$content_func} )actionline 621 (+68 into the body)
Fires in the admin header for each specific form tab in the legacy (pre-3.5.0) media upload popup.
- do_action( admin_print_footer_scripts )actionline 641 (+88 into the body)
Prints any scripts and data queued for the footer.
Uses · 11
- _wp_admin_html_begin()Prints out the beginning of the admin HTML header.
- bloginfo()Displays information about the current site.
- _e()Displays translated text.
- wp_enqueue_style()Enqueues a CSS stylesheet.
- str_starts_with()Polyfill for `str_starts_with()` function added in PHP 8.0.
- esc_js()Escapes single quotes, `"`, ``, `&`, and fixes line endings.
- admin_url()Retrieves the URL to the admin area for the current site.
- is_rtl()Determines whether the current locale is right-to-left (RTL).
- do_action()Calls the callback functions that have been added to an action hook.
- sanitize_html_class()Sanitizes an HTML classname to ensure it only contains valid characters.
- get_user_option()Retrieves user option that can be either per Site or per Network.
Used by · 3
- media_upload_gallery()Retrieves the legacy media uploader form in an iframe.
- media_upload_library()Retrieves the legacy media library form in an iframe.
- wp_media_upload_handler()Handles the process of uploading media.
Source
function wp_iframe( $content_func, ...$args ) { global $body_id; _wp_admin_html_begin(); ?> <title><?php bloginfo( 'name' ); ?> › <?php _e( 'Uploads' ); ?> — <?php _e( 'WordPress' ); ?></title> <?php wp_enqueue_style( 'colors' ); // Check callback name for 'media'. if ( ( is_array( $content_func ) && ! empty( $content_func[1] ) && str_starts_with( (string) $content_func[1], 'media' ) ) || ( ! is_array( $content_func ) && str_starts_with( $content_func, 'media' ) ) ) { wp_enqueue_style( 'deprecated-media' ); } ?> <script> addLoadEvent = function(func){if(typeof jQuery!=='undefined')jQuery(function(){func();});else if(typeof wpOnload!=='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}}; var ajaxurl = '<?php echo esc_js( admin_url( 'admin-ajax.php', 'relative' ) ); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup', isRtl = <?php echo (int) is_rtl(); ?>; </script> <?php /** This action is documented in wp-admin/admin-header.php */ do_action( 'admin_enqueue_scripts', 'media-upload-popup' ); /** * Fires when admin styles enqueued for the legacy (pre-3.5.0) media upload popup are printed. * * @since 2.9.0 */ do_action( 'admin_print_styles-media-upload-popup' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores /** This action is documented in wp-admin/admin-header.php */ do_action( 'admin_print_styles' ); /** * Fires when admin scripts enqueued for the legacy (pre-3.5.0) media upload popup are printed. * * @since 2.9.0 */ do_action( 'admin_print_scripts-media-upload-popup' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores /** This action is documented in wp-admin/admin-header.php */ do_action( 'admin_print_scripts' ); /** * Fires when scripts enqueued for the admin header for the legacy (pre-3.5.0) * media upload popup are printed. * * @since 2.9.0 */ do_action( 'admin_head-media-upload-popup' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores /** This action is documented in wp-admin/admin-header.php */ do_action( 'admin_head' ); if ( is_string( $content_func ) ) { /** * Fires in the admin header for each specific form tab in the legacy * (pre-3.5.0) media upload popup. * * The dynamic portion of the hook name, `$content_func`, refers to the form * callback for the media upload type. * * @since 2.5.0 */ do_action( "admin_head_{$content_func}" ); } $body_id_attr = ''; if ( isset( $body_id ) ) { $body_id_attr = ' id="' . $body_id . '"'; } ?> </head> <body<?php echo $body_id_attr; ?> class="wp-core-ui no-js <?php echo 'admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'modern' ); ?>">History
Introduced in 2.5.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
...$args parameter by adding it to the function signature.from the docblockAbout this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, from
src/wp-admin/includes/media.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.