0
|
1 |
<?php |
|
2 |
/** |
|
3 |
* WordPress Administration Template Header |
|
4 |
* |
|
5 |
* @package WordPress |
|
6 |
* @subpackage Administration |
|
7 |
*/ |
|
8 |
|
|
9 |
@header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); |
|
10 |
if ( ! defined( 'WP_ADMIN' ) ) |
|
11 |
require_once( dirname( __FILE__ ) . '/admin.php' ); |
|
12 |
|
|
13 |
// In case admin-header.php is included in a function. |
|
14 |
global $title, $hook_suffix, $current_screen, $wp_locale, $pagenow, $wp_version, |
5
|
15 |
$update_title, $total_update_count, $parent_file; |
0
|
16 |
|
|
17 |
// Catch plugins that include admin-header.php before admin.php completes. |
|
18 |
if ( empty( $current_screen ) ) |
|
19 |
set_current_screen(); |
|
20 |
|
|
21 |
get_admin_page_title(); |
|
22 |
$title = esc_html( strip_tags( $title ) ); |
|
23 |
|
|
24 |
if ( is_network_admin() ) |
5
|
25 |
$admin_title = sprintf( __( 'Network Admin: %s' ), esc_html( get_current_site()->site_name ) ); |
0
|
26 |
elseif ( is_user_admin() ) |
5
|
27 |
$admin_title = sprintf( __( 'Global Dashboard: %s' ), esc_html( get_current_site()->site_name ) ); |
0
|
28 |
else |
|
29 |
$admin_title = get_bloginfo( 'name' ); |
|
30 |
|
|
31 |
if ( $admin_title == $title ) |
|
32 |
$admin_title = sprintf( __( '%1$s — WordPress' ), $title ); |
|
33 |
else |
|
34 |
$admin_title = sprintf( __( '%1$s ‹ %2$s — WordPress' ), $title, $admin_title ); |
|
35 |
|
|
36 |
/** |
5
|
37 |
* Filter the title tag content for an admin page. |
0
|
38 |
* |
|
39 |
* @since 3.1.0 |
|
40 |
* |
|
41 |
* @param string $admin_title The page title, with extra context added. |
|
42 |
* @param string $title The original page title. |
|
43 |
*/ |
|
44 |
$admin_title = apply_filters( 'admin_title', $admin_title, $title ); |
|
45 |
|
|
46 |
wp_user_settings(); |
|
47 |
|
|
48 |
_wp_admin_html_begin(); |
|
49 |
?> |
|
50 |
<title><?php echo $admin_title; ?></title> |
|
51 |
<?php |
|
52 |
|
|
53 |
wp_enqueue_style( 'colors' ); |
|
54 |
wp_enqueue_style( 'ie' ); |
|
55 |
wp_enqueue_script('utils'); |
5
|
56 |
wp_enqueue_script( 'svg-painter' ); |
0
|
57 |
|
|
58 |
$admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix); |
|
59 |
?> |
|
60 |
<script type="text/javascript"> |
|
61 |
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();}}}; |
|
62 |
var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>', |
|
63 |
pagenow = '<?php echo $current_screen->id; ?>', |
|
64 |
typenow = '<?php echo $current_screen->post_type; ?>', |
|
65 |
adminpage = '<?php echo $admin_body_class; ?>', |
|
66 |
thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>', |
|
67 |
decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>', |
|
68 |
isRtl = <?php echo (int) is_rtl(); ?>; |
|
69 |
</script> |
5
|
70 |
<meta name="viewport" content="width=device-width,initial-scale=1.0"> |
0
|
71 |
<?php |
|
72 |
|
|
73 |
/** |
|
74 |
* Enqueue scripts for all admin pages. |
|
75 |
* |
|
76 |
* @since 2.8.0 |
|
77 |
* |
|
78 |
* @param string $hook_suffix The current admin page. |
|
79 |
*/ |
|
80 |
do_action( 'admin_enqueue_scripts', $hook_suffix ); |
|
81 |
|
|
82 |
/** |
5
|
83 |
* Fires when styles are printed for a specific admin page based on $hook_suffix. |
0
|
84 |
* |
|
85 |
* @since 2.6.0 |
|
86 |
*/ |
|
87 |
do_action( "admin_print_styles-$hook_suffix" ); |
|
88 |
|
|
89 |
/** |
5
|
90 |
* Fires when styles are printed for all admin pages. |
0
|
91 |
* |
|
92 |
* @since 2.6.0 |
|
93 |
*/ |
|
94 |
do_action( 'admin_print_styles' ); |
|
95 |
|
|
96 |
/** |
5
|
97 |
* Fires when scripts are printed for a specific admin page based on $hook_suffix. |
0
|
98 |
* |
|
99 |
* @since 2.1.0 |
|
100 |
*/ |
|
101 |
do_action( "admin_print_scripts-$hook_suffix" ); |
|
102 |
|
|
103 |
/** |
5
|
104 |
* Fires when scripts are printed for all admin pages. |
0
|
105 |
* |
|
106 |
* @since 2.1.0 |
|
107 |
*/ |
|
108 |
do_action( 'admin_print_scripts' ); |
|
109 |
|
|
110 |
/** |
5
|
111 |
* Fires in head section for a specific admin page. |
|
112 |
* |
|
113 |
* The dynamic portion of the hook, `$hook_suffix`, refers to the hook suffix |
|
114 |
* for the admin page. |
0
|
115 |
* |
|
116 |
* @since 2.1.0 |
|
117 |
*/ |
|
118 |
do_action( "admin_head-$hook_suffix" ); |
|
119 |
|
|
120 |
/** |
5
|
121 |
* Fires in head section for all admin pages. |
0
|
122 |
* |
|
123 |
* @since 2.1.0 |
|
124 |
*/ |
|
125 |
do_action( 'admin_head' ); |
|
126 |
|
|
127 |
if ( get_user_setting('mfold') == 'f' ) |
|
128 |
$admin_body_class .= ' folded'; |
|
129 |
|
|
130 |
if ( !get_user_setting('unfold') ) |
|
131 |
$admin_body_class .= ' auto-fold'; |
|
132 |
|
|
133 |
if ( is_admin_bar_showing() ) |
|
134 |
$admin_body_class .= ' admin-bar'; |
|
135 |
|
|
136 |
if ( is_rtl() ) |
|
137 |
$admin_body_class .= ' rtl'; |
|
138 |
|
|
139 |
if ( $current_screen->post_type ) |
|
140 |
$admin_body_class .= ' post-type-' . $current_screen->post_type; |
|
141 |
|
|
142 |
if ( $current_screen->taxonomy ) |
|
143 |
$admin_body_class .= ' taxonomy-' . $current_screen->taxonomy; |
|
144 |
|
|
145 |
$admin_body_class .= ' branch-' . str_replace( array( '.', ',' ), '-', floatval( $wp_version ) ); |
|
146 |
$admin_body_class .= ' version-' . str_replace( '.', '-', preg_replace( '/^([.0-9]+).*/', '$1', $wp_version ) ); |
|
147 |
$admin_body_class .= ' admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'fresh' ); |
|
148 |
$admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) ); |
|
149 |
|
|
150 |
if ( wp_is_mobile() ) |
|
151 |
$admin_body_class .= ' mobile'; |
|
152 |
|
5
|
153 |
if ( is_multisite() ) |
|
154 |
$admin_body_class .= ' multisite'; |
|
155 |
|
|
156 |
if ( is_network_admin() ) |
|
157 |
$admin_body_class .= ' network-admin'; |
|
158 |
|
|
159 |
$admin_body_class .= ' no-customize-support no-svg'; |
0
|
160 |
|
|
161 |
?> |
|
162 |
</head> |
|
163 |
<?php |
|
164 |
/** |
5
|
165 |
* Filter the CSS classes for the body tag in the admin. |
0
|
166 |
* |
5
|
167 |
* This filter differs from the {@see 'post_class'} and {@see 'body_class'} filters |
|
168 |
* in two important ways: |
|
169 |
* |
|
170 |
* 1. `$classes` is a space-separated string of class names instead of an array. |
|
171 |
* 2. Not all core admin classes are filterable, notably: wp-admin, wp-core-ui, |
|
172 |
* and no-js cannot be removed. |
0
|
173 |
* |
|
174 |
* @since 2.3.0 |
|
175 |
* |
5
|
176 |
* @param string $classes Space-separated list of CSS classes. |
0
|
177 |
*/ |
5
|
178 |
$admin_body_classes = apply_filters( 'admin_body_class', '' ); |
0
|
179 |
?> |
5
|
180 |
<body class="wp-admin wp-core-ui no-js <?php echo $admin_body_classes . ' ' . $admin_body_class; ?>"> |
0
|
181 |
<script type="text/javascript"> |
|
182 |
document.body.className = document.body.className.replace('no-js','js'); |
|
183 |
</script> |
|
184 |
|
|
185 |
<?php |
|
186 |
// Make sure the customize body classes are correct as early as possible. |
5
|
187 |
if ( current_user_can( 'customize' ) ) { |
0
|
188 |
wp_customize_support_script(); |
5
|
189 |
} |
0
|
190 |
?> |
|
191 |
|
|
192 |
<div id="wpwrap"> |
|
193 |
<?php require(ABSPATH . 'wp-admin/menu-header.php'); ?> |
|
194 |
<div id="wpcontent"> |
|
195 |
|
|
196 |
<?php |
|
197 |
/** |
|
198 |
* Fires at the beginning of the content section in an admin page. |
|
199 |
* |
|
200 |
* @since 3.0.0 |
|
201 |
*/ |
|
202 |
do_action( 'in_admin_header' ); |
|
203 |
?> |
|
204 |
|
5
|
205 |
<div id="wpbody" role="main"> |
0
|
206 |
<?php |
|
207 |
unset($title_class, $blog_name, $total_update_count, $update_title); |
|
208 |
|
|
209 |
$current_screen->set_parentage( $parent_file ); |
|
210 |
|
|
211 |
?> |
|
212 |
|
|
213 |
<div id="wpbody-content" aria-label="<?php esc_attr_e('Main content'); ?>" tabindex="0"> |
|
214 |
<?php |
|
215 |
|
|
216 |
$current_screen->render_screen_meta(); |
|
217 |
|
|
218 |
if ( is_network_admin() ) { |
|
219 |
/** |
|
220 |
* Print network admin screen notices. |
|
221 |
* |
|
222 |
* @since 3.1.0 |
|
223 |
*/ |
|
224 |
do_action( 'network_admin_notices' ); |
|
225 |
} elseif ( is_user_admin() ) { |
|
226 |
/** |
|
227 |
* Print user admin screen notices. |
|
228 |
* |
|
229 |
* @since 3.1.0 |
|
230 |
*/ |
|
231 |
do_action( 'user_admin_notices' ); |
|
232 |
} else { |
|
233 |
/** |
|
234 |
* Print admin screen notices. |
|
235 |
* |
|
236 |
* @since 3.1.0 |
|
237 |
*/ |
|
238 |
do_action( 'admin_notices' ); |
|
239 |
} |
|
240 |
|
|
241 |
/** |
|
242 |
* Print generic admin screen notices. |
|
243 |
* |
|
244 |
* @since 3.1.0 |
|
245 |
*/ |
|
246 |
do_action( 'all_admin_notices' ); |
|
247 |
|
|
248 |
if ( $parent_file == 'options-general.php' ) |
|
249 |
require(ABSPATH . 'wp-admin/options-head.php'); |