3 * WordPress Administration Template Header
6 * @subpackage Administration
9 @header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
10 if ( ! defined( 'WP_ADMIN' ) )
11 require_once( './admin.php' );
13 // In case admin-header.php is included in a function.
14 global $title, $hook_suffix, $current_screen, $wp_locale, $pagenow, $wp_version,
15 $current_site, $update_title, $total_update_count, $parent_file;
17 // Catch plugins that include admin-header.php before admin.php completes.
18 if ( empty( $current_screen ) )
21 get_admin_page_title();
22 $title = esc_html( strip_tags( $title ) );
24 if ( is_network_admin() )
25 $admin_title = __( 'Network Admin' );
26 elseif ( is_user_admin() )
27 $admin_title = __( 'Global Dashboard' );
29 $admin_title = get_bloginfo( 'name' );
31 if ( $admin_title == $title )
32 $admin_title = sprintf( __( '%1$s — WordPress' ), $title );
34 $admin_title = sprintf( __( '%1$s ‹ %2$s — WordPress' ), $title, $admin_title );
36 $admin_title = apply_filters( 'admin_title', $admin_title, $title );
40 _wp_admin_html_begin();
42 <title><?php echo $admin_title; ?></title>
45 wp_enqueue_style( 'colors' );
46 wp_enqueue_style( 'ie' );
47 wp_enqueue_script('utils');
49 $admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix);
51 <script type="text/javascript">
52 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();}}};
53 var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>',
54 pagenow = '<?php echo $current_screen->id; ?>',
55 typenow = '<?php echo $current_screen->post_type; ?>',
56 adminpage = '<?php echo $admin_body_class; ?>',
57 thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>',
58 decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>',
59 isRtl = <?php echo (int) is_rtl(); ?>;
63 do_action('admin_enqueue_scripts', $hook_suffix);
64 do_action("admin_print_styles-$hook_suffix");
65 do_action('admin_print_styles');
66 do_action("admin_print_scripts-$hook_suffix");
67 do_action('admin_print_scripts');
68 do_action("admin_head-$hook_suffix");
69 do_action('admin_head');
71 if ( get_user_setting('mfold') == 'f' )
72 $admin_body_class .= ' folded';
74 if ( !get_user_setting('unfold') )
75 $admin_body_class .= ' auto-fold';
77 if ( is_admin_bar_showing() )
78 $admin_body_class .= ' admin-bar';
81 $admin_body_class .= ' rtl';
83 $admin_body_class .= ' branch-' . str_replace( array( '.', ',' ), '-', floatval( $wp_version ) );
84 $admin_body_class .= ' version-' . str_replace( '.', '-', preg_replace( '/^([.0-9]+).*/', '$1', $wp_version ) );
85 $admin_body_class .= ' admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'fresh' );
86 $admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) );
89 $admin_body_class .= ' mobile';
91 $admin_body_class .= ' no-customize-support';
95 <body class="wp-admin wp-core-ui no-js <?php echo apply_filters( 'admin_body_class', '' ) . " $admin_body_class"; ?>">
96 <script type="text/javascript">
97 document.body.className = document.body.className.replace('no-js','js');
101 // Make sure the customize body classes are correct as early as possible.
102 if ( current_user_can( 'edit_theme_options' ) )
103 wp_customize_support_script();
107 <a tabindex="1" href="#wpbody-content" class="screen-reader-shortcut"><?php _e('Skip to main content'); ?></a>
108 <?php require(ABSPATH . 'wp-admin/menu-header.php'); ?>
112 do_action('in_admin_header');
117 unset($title_class, $blog_name, $total_update_count, $update_title);
119 $current_screen->set_parentage( $parent_file );
123 <div id="wpbody-content" aria-label="<?php esc_attr_e('Main content'); ?>" tabindex="0">
126 $current_screen->render_screen_meta();
128 if ( is_network_admin() )
129 do_action('network_admin_notices');
130 elseif ( is_user_admin() )
131 do_action('user_admin_notices');
133 do_action('admin_notices');
135 do_action('all_admin_notices');
137 if ( $parent_file == 'options-general.php' )
138 require(ABSPATH . 'wp-admin/options-head.php');