wp_iframe

Adds the iframe to display content for the media upload page.

Description

wp_iframe( (string|callable) $content_func ); 

Parameters (1)

0. $content_func (string|callable)
The content func.

Usage

  1. if ( !function_exists( 'wp_iframe' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/media.php'; 
  3.  
  4. // The content func. 
  5. $content_func = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wp_iframe($content_func); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/media.php  
  1. function wp_iframe($content_func /** ... */) { 
  2. ?> 
  3. <title><?php bloginfo('name') ?> › <?php _e('Uploads'); ?> — <?php _e('WordPress'); ?></title> 
  4. <?php 
  5.  
  6. wp_enqueue_style( 'colors' ); 
  7. // Check callback name for 'media' 
  8. if ( ( is_array( $content_func ) && ! empty( $content_func[1] ) && 0 === strpos( (string) $content_func[1], 'media' ) ) 
  9. || ( ! is_array( $content_func ) && 0 === strpos( $content_func, 'media' ) ) ) 
  10. wp_enqueue_style( 'deprecated-media' ); 
  11. wp_enqueue_style( 'ie' ); 
  12. ?> 
  13. <script type="text/javascript"> 
  14. addLoadEvent = function(func) {if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function') {wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function() {oldonload();func();}}}; 
  15. var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup',  
  16. isRtl = <?php echo (int) is_rtl(); ?>; 
  17. </script> 
  18. <?php 
  19. /** This action is documented in wp-admin/admin-header.php */ 
  20. do_action( 'admin_enqueue_scripts', 'media-upload-popup' ); 
  21.  
  22. /** 
  23. * Fires when admin styles enqueued for the legacy (pre-3.5.0) media upload popup are printed. 
  24. * @since 2.9.0 
  25. */ 
  26.  
  27. /** This action is documented in wp-admin/admin-header.php */ 
  28.  
  29. /** 
  30. * Fires when admin scripts enqueued for the legacy (pre-3.5.0) media upload popup are printed. 
  31. * @since 2.9.0 
  32. */ 
  33.  
  34. /** This action is documented in wp-admin/admin-header.php */ 
  35.  
  36. /** 
  37. * Fires when scripts enqueued for the admin header for the legacy (pre-3.5.0) 
  38. * media upload popup are printed. 
  39. * @since 2.9.0 
  40. */ 
  41.  
  42. /** This action is documented in wp-admin/admin-header.php */ 
  43.  
  44. if ( is_string( $content_func ) ) { 
  45. /** 
  46. * Fires in the admin header for each specific form tab in the legacy 
  47. * (pre-3.5.0) media upload popup. 
  48. * The dynamic portion of the hook, `$content_func`, refers to the form 
  49. * callback for the media upload type. Possible values include 
  50. * @since 2.5.0 
  51. */ 
  52. do_action( "admin_head_{$content_func}" ); 
  53. ?> 
  54. </head> 
  55. <body<?php if ( isset($GLOBALS['body_id']) ) echo ' id="' . $GLOBALS['body_id'] . '"'; ?> class="wp-core-ui no-js"> 
  56. <script type="text/javascript"> 
  57. document.body.className = document.body.className.replace('no-js', 'js'); 
  58. </script> 
  59. <?php 
  60. $args = func_get_args(); 
  61. $args = array_slice($args, 1); 
  62. call_user_func_array($content_func, $args); 
  63.  
  64. /** This action is documented in wp-admin/admin-footer.php */ 
  65. ?> 
  66. <script type="text/javascript">if(typeof wpOnload=='function')wpOnload();</script> 
  67. </body> 
  68. </html> 
  69. <?php