iframe_header

Generic Iframe header for use with Thickbox.

Description

iframe_header( (string) $title = '', (bool) $deprecated = false ); 

Parameters (2)

0. $title — Optional. (string) => ''
Title of the Iframe page. Default empty.
1. $deprecated — Optional. (bool) => false
The deprecated.

Usage

  1. if ( !function_exists( 'iframe_header' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/template.php'; 
  3.  
  4. // Optional. Title of the Iframe page. Default empty. 
  5. $title = ''; 
  6.  
  7. // The deprecated. 
  8. $deprecated = false; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = iframe_header($title, $deprecated); 
  12.  

Defined (1)

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

/wp-admin/includes/template.php  
  1. function iframe_header( $title = '', $deprecated = false ) { 
  2. show_admin_bar( false ); 
  3. global $hook_suffix, $admin_body_class, $wp_locale; 
  4. $admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix); 
  5.  
  6. $current_screen = get_current_screen(); 
  7.  
  8. @header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) ); 
  9. ?> 
  10. <title><?php bloginfo('name') ?> › <?php echo $title ?> — <?php _e('WordPress'); ?></title> 
  11. <?php 
  12. wp_enqueue_style( 'colors' ); 
  13. ?> 
  14. <script type="text/javascript"> 
  15. 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();}}}; 
  16. function tb_close() {var win=window.dialogArguments||opener||parent||top;win.tb_remove();} 
  17. var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>',  
  18. pagenow = '<?php echo $current_screen->id; ?>',  
  19. typenow = '<?php echo $current_screen->post_type; ?>',  
  20. adminpage = '<?php echo $admin_body_class; ?>',  
  21. thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>',  
  22. decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>',  
  23. isRtl = <?php echo (int) is_rtl(); ?>; 
  24. </script> 
  25. <?php 
  26. /** This action is documented in wp-admin/admin-header.php */ 
  27. do_action( 'admin_enqueue_scripts', $hook_suffix ); 
  28.  
  29. /** This action is documented in wp-admin/admin-header.php */ 
  30. do_action( "admin_print_styles-$hook_suffix" ); 
  31.  
  32. /** This action is documented in wp-admin/admin-header.php */ 
  33. do_action( 'admin_print_styles' ); 
  34.  
  35. /** This action is documented in wp-admin/admin-header.php */ 
  36. do_action( "admin_print_scripts-$hook_suffix" ); 
  37.  
  38. /** This action is documented in wp-admin/admin-header.php */ 
  39. do_action( 'admin_print_scripts' ); 
  40.  
  41. /** This action is documented in wp-admin/admin-header.php */ 
  42. do_action( "admin_head-$hook_suffix" ); 
  43.  
  44. /** This action is documented in wp-admin/admin-header.php */ 
  45. do_action( 'admin_head' ); 
  46.  
  47. $admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) ); 
  48.  
  49. if ( is_rtl() ) 
  50. $admin_body_class .= ' rtl'; 
  51.  
  52. ?> 
  53. </head> 
  54. <?php 
  55. /** This filter is documented in wp-admin/admin-header.php */ 
  56. $admin_body_classes = apply_filters( 'admin_body_class', '' ); 
  57. ?> 
  58. <body<?php 
  59. /** 
  60. * @global string $body_id 
  61. */ 
  62. if ( isset($GLOBALS['body_id']) ) echo ' id="' . $GLOBALS['body_id'] . '"'; ?> class="wp-admin wp-core-ui no-js iframe <?php echo $admin_body_classes . ' ' . $admin_body_class; ?>"> 
  63. <script type="text/javascript"> 
  64. (function() { 
  65. var c = document.body.className; 
  66. c = c.replace(/no-js/, 'js'); 
  67. document.body.className = c; 
  68. })(); 
  69. </script> 
  70. <?php