Advertisements

iframe_header

Definition:
function iframe_header( $title = '', $limit_styles = false ) {}

Generic Iframe header for use with Thickbox

Parameters

  • string $title: Title of the Iframe page.
  • bool $limit_styles: Limit styles to colour-related styles only (unless others are enqueued).

Defined actions

  • admin_xml_ns
    do_action('admin_xml_ns');
  • admin_enqueue_scripts
    do_action('admin_enqueue_scripts', $hook_suffix);
  • admin_print_styles-$hook_suffix
    do_action("admin_print_styles-$hook_suffix");
  • admin_print_styles
    do_action('admin_print_styles');
  • admin_print_scripts-$hook_suffix
    do_action("admin_print_scripts-$hook_suffix");
  • admin_print_scripts
    do_action('admin_print_scripts');
  • admin_head-$hook_suffix
    do_action("admin_head-$hook_suffix");
  • admin_head
    do_action('admin_head');

Source code

function iframe_header( $title = '', $limit_styles = false ) {

	show_admin_bar( false );

	global $hook_suffix, $current_screen, $current_user, $admin_body_class, $wp_locale;

	$admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix);

	$admin_body_class .= ' iframe';



?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>>

<head>

<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />

<title><?php bloginfo('name') ?> &rsaquo; <?php echo $title ?> — <?php _e('WordPress'); ?></title>

<?php

wp_enqueue_style( 'global' );

if ( ! $limit_styles )

	wp_enqueue_style( 'wp-admin' );

wp_enqueue_style( 'colors' );

?>

<script type="text/javascript">

//<![CDATA[

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();}}};

function tb_close(){var win=window.dialogArguments||opener||parent||top;win.tb_remove();}

var userSettings = {

		'url': '<?php echo SITECOOKIEPATH; ?>',

		'uid': '<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>',

		'time':'<?php echo time() ?>'

	},

	ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>',

	pagenow = '<?php echo $current_screen->id; ?>',

	typenow = '<?php if ( isset($current_screen->post_type) ) echo $current_screen->post_type; ?>',

	adminpage = '<?php echo $admin_body_class; ?>',

	thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>',

	decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>',

	isRtl = <?php echo (int) is_rtl(); ?>;

//]]>

</script>

<?php

do_action('admin_enqueue_scripts', $hook_suffix);

do_action("admin_print_styles-$hook_suffix");

do_action('admin_print_styles');

do_action("admin_print_scripts-$hook_suffix");

do_action('admin_print_scripts');

do_action("admin_head-$hook_suffix");

do_action('admin_head');

?>

</head>

<body<?php if ( isset($GLOBALS['body_id']) ) echo ' id="' . $GLOBALS['body_id'] . '"'; ?>  class="no-js <?php echo $admin_body_class; ?>">

<script type="text/javascript">

//<![CDATA[

(function(){

var c = document.body.className;

c = c.replace(/no-js/, 'js');

document.body.className = c;

})();

//]]>

</script>

<?php

}

1963

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: