8 |
8 |
9 @header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); |
9 @header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); |
10 if ( ! defined( 'WP_ADMIN' ) ) |
10 if ( ! defined( 'WP_ADMIN' ) ) |
11 require_once( dirname( __FILE__ ) . '/admin.php' ); |
11 require_once( dirname( __FILE__ ) . '/admin.php' ); |
12 |
12 |
13 // In case admin-header.php is included in a function. |
13 /** |
14 global $title, $hook_suffix, $current_screen, $wp_locale, $pagenow, $wp_version, |
14 * In case admin-header.php is included in a function. |
|
15 * |
|
16 * @global string $title |
|
17 * @global string $hook_suffix |
|
18 * @global WP_Screen $current_screen |
|
19 * @global WP_Locale $wp_locale |
|
20 * @global string $pagenow |
|
21 * @global string $update_title |
|
22 * @global int $total_update_count |
|
23 * @global string $parent_file |
|
24 */ |
|
25 global $title, $hook_suffix, $current_screen, $wp_locale, $pagenow, |
15 $update_title, $total_update_count, $parent_file; |
26 $update_title, $total_update_count, $parent_file; |
16 |
27 |
17 // Catch plugins that include admin-header.php before admin.php completes. |
28 // Catch plugins that include admin-header.php before admin.php completes. |
18 if ( empty( $current_screen ) ) |
29 if ( empty( $current_screen ) ) |
19 set_current_screen(); |
30 set_current_screen(); |
20 |
31 |
21 get_admin_page_title(); |
32 get_admin_page_title(); |
22 $title = esc_html( strip_tags( $title ) ); |
33 $title = esc_html( strip_tags( $title ) ); |
23 |
34 |
24 if ( is_network_admin() ) |
35 if ( is_network_admin() ) { |
25 $admin_title = sprintf( __( 'Network Admin: %s' ), esc_html( get_current_site()->site_name ) ); |
36 /* translators: Network admin screen title. 1: Network name */ |
26 elseif ( is_user_admin() ) |
37 $admin_title = sprintf( __( 'Network Admin: %s' ), esc_html( get_network()->site_name ) ); |
27 $admin_title = sprintf( __( 'Global Dashboard: %s' ), esc_html( get_current_site()->site_name ) ); |
38 } elseif ( is_user_admin() ) { |
28 else |
39 /* translators: User dashboard screen title. 1: Network name */ |
|
40 $admin_title = sprintf( __( 'User Dashboard: %s' ), esc_html( get_network()->site_name ) ); |
|
41 } else { |
29 $admin_title = get_bloginfo( 'name' ); |
42 $admin_title = get_bloginfo( 'name' ); |
30 |
43 } |
31 if ( $admin_title == $title ) |
44 |
|
45 if ( $admin_title == $title ) { |
|
46 /* translators: Admin screen title. 1: Admin screen name */ |
32 $admin_title = sprintf( __( '%1$s — WordPress' ), $title ); |
47 $admin_title = sprintf( __( '%1$s — WordPress' ), $title ); |
33 else |
48 } else { |
|
49 /* translators: Admin screen title. 1: Admin screen name, 2: Network or site name */ |
34 $admin_title = sprintf( __( '%1$s ‹ %2$s — WordPress' ), $title, $admin_title ); |
50 $admin_title = sprintf( __( '%1$s ‹ %2$s — WordPress' ), $title, $admin_title ); |
35 |
51 } |
36 /** |
52 |
37 * Filter the title tag content for an admin page. |
53 /** |
|
54 * Filters the title tag content for an admin page. |
38 * |
55 * |
39 * @since 3.1.0 |
56 * @since 3.1.0 |
40 * |
57 * |
41 * @param string $admin_title The page title, with extra context added. |
58 * @param string $admin_title The page title, with extra context added. |
42 * @param string $title The original page title. |
59 * @param string $title The original page title. |
140 $admin_body_class .= ' post-type-' . $current_screen->post_type; |
157 $admin_body_class .= ' post-type-' . $current_screen->post_type; |
141 |
158 |
142 if ( $current_screen->taxonomy ) |
159 if ( $current_screen->taxonomy ) |
143 $admin_body_class .= ' taxonomy-' . $current_screen->taxonomy; |
160 $admin_body_class .= ' taxonomy-' . $current_screen->taxonomy; |
144 |
161 |
145 $admin_body_class .= ' branch-' . str_replace( array( '.', ',' ), '-', floatval( $wp_version ) ); |
162 $admin_body_class .= ' branch-' . str_replace( array( '.', ',' ), '-', floatval( get_bloginfo( 'version' ) ) ); |
146 $admin_body_class .= ' version-' . str_replace( '.', '-', preg_replace( '/^([.0-9]+).*/', '$1', $wp_version ) ); |
163 $admin_body_class .= ' version-' . str_replace( '.', '-', preg_replace( '/^([.0-9]+).*/', '$1', get_bloginfo( 'version' ) ) ); |
147 $admin_body_class .= ' admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'fresh' ); |
164 $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() ) ) ); |
165 $admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) ); |
149 |
166 |
150 if ( wp_is_mobile() ) |
167 if ( wp_is_mobile() ) |
151 $admin_body_class .= ' mobile'; |
168 $admin_body_class .= ' mobile'; |
152 |
169 |
153 if ( is_multisite() ) |
170 if ( is_multisite() ) |
215 |
232 |
216 $current_screen->render_screen_meta(); |
233 $current_screen->render_screen_meta(); |
217 |
234 |
218 if ( is_network_admin() ) { |
235 if ( is_network_admin() ) { |
219 /** |
236 /** |
220 * Print network admin screen notices. |
237 * Prints network admin screen notices. |
221 * |
238 * |
222 * @since 3.1.0 |
239 * @since 3.1.0 |
223 */ |
240 */ |
224 do_action( 'network_admin_notices' ); |
241 do_action( 'network_admin_notices' ); |
225 } elseif ( is_user_admin() ) { |
242 } elseif ( is_user_admin() ) { |
226 /** |
243 /** |
227 * Print user admin screen notices. |
244 * Prints user admin screen notices. |
228 * |
245 * |
229 * @since 3.1.0 |
246 * @since 3.1.0 |
230 */ |
247 */ |
231 do_action( 'user_admin_notices' ); |
248 do_action( 'user_admin_notices' ); |
232 } else { |
249 } else { |
233 /** |
250 /** |
234 * Print admin screen notices. |
251 * Prints admin screen notices. |
235 * |
252 * |
236 * @since 3.1.0 |
253 * @since 3.1.0 |
237 */ |
254 */ |
238 do_action( 'admin_notices' ); |
255 do_action( 'admin_notices' ); |
239 } |
256 } |
240 |
257 |
241 /** |
258 /** |
242 * Print generic admin screen notices. |
259 * Prints generic admin screen notices. |
243 * |
260 * |
244 * @since 3.1.0 |
261 * @since 3.1.0 |
245 */ |
262 */ |
246 do_action( 'all_admin_notices' ); |
263 do_action( 'all_admin_notices' ); |
247 |
264 |