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();}}};
54 'url': '<?php echo SITECOOKIEPATH; ?>',
55 'uid': '<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>',
56 'time':'<?php echo time() ?>'
58 ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>',
59 pagenow = '<?php echo $current_screen->id; ?>',
60 typenow = '<?php echo $current_screen->post_type; ?>',
61 adminpage = '<?php echo $admin_body_class; ?>',
62 thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>',
63 decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>',
64 isRtl = <?php echo (int) is_rtl(); ?>;
68 do_action('admin_enqueue_scripts', $hook_suffix);
69 do_action("admin_print_styles-$hook_suffix");
70 do_action('admin_print_styles');
71 do_action("admin_print_scripts-$hook_suffix");
72 do_action('admin_print_scripts');
73 do_action("admin_head-$hook_suffix");
74 do_action('admin_head');
76 if ( get_user_setting('mfold') == 'f' )
77 $admin_body_class .= ' folded';
79 if ( is_admin_bar_showing() )
80 $admin_body_class .= ' admin-bar';
83 $admin_body_class .= ' rtl';
85 $admin_body_class .= ' branch-' . str_replace( array( '.', ',' ), '-', floatval( $wp_version ) );
86 $admin_body_class .= ' version-' . str_replace( '.', '-', preg_replace( '/^([.0-9]+).*/', '$1', $wp_version ) );
87 $admin_body_class .= ' admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'fresh' );
88 $admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) );
91 $admin_body_class .= ' mobile';
93 $admin_body_class .= ' no-customize-support';
97 <body class="wp-admin no-js <?php echo apply_filters( 'admin_body_class', '' ) . " $admin_body_class"; ?>">
98 <script type="text/javascript">
99 document.body.className = document.body.className.replace('no-js','js');
103 // If the customize-loader script is enqueued, make sure the customize
104 // body classes are correct as early as possible.
105 if ( wp_script_is( 'customize-loader', 'queue' ) && current_user_can( 'edit_theme_options' ) )
106 wp_customize_support_script();
110 <?php require(ABSPATH . 'wp-admin/menu-header.php'); ?>
114 do_action('in_admin_header');
119 unset($title_class, $blog_name, $total_update_count, $update_title);
121 $current_screen->set_parentage( $parent_file );
125 <div id="wpbody-content">
128 $current_screen->render_screen_meta();
130 if ( is_network_admin() )
131 do_action('network_admin_notices');
132 elseif ( is_user_admin() )
133 do_action('user_admin_notices');
135 do_action('admin_notices');
137 do_action('all_admin_notices');
139 if ( $parent_file == 'options-general.php' )
140 require(ABSPATH . 'wp-admin/options-head.php');