/** * In case admin-header.php is included in a function. * * @global string $title The title of the current screen. * @global string $hook_suffix * @global WP_Screen $current_screen WordPress current screen object. * @global WP_Locale $wp_locale WordPress date and time locale object. * @global string $pagenow The filename of the current screen. * @global string $update_title * @global int $total_update_count * @global string $parent_file * @global string $typenow The post type of the current screen. */ global $title, $hook_suffix, $current_screen, $wp_locale, $pagenow, $update_title, $total_update_count, $parent_file, $typenow;
// Catch plugins that include admin-header.php before admin.php completes. if ( empty( $current_screen ) ) { set_current_screen(); }
/** * Filters the title tag content for an admin page. * * @since 3.1.0 * * @param string $admin_title The page title, with extra context added. * @param string $title The original page title. */ $admin_title = apply_filters( 'admin_title', $admin_title, $title );
/** * Fires when enqueuing scripts for all admin pages. * * @since 2.8.0 * * @param string $hook_suffix The current admin page. */ do_action( 'admin_enqueue_scripts', $hook_suffix );
/** * Fires when styles are printed for a specific admin page based on $hook_suffix. * * @since 2.6.0 */ do_action( "admin_print_styles-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
/** * Fires when styles are printed for all admin pages. * * @since 2.6.0 */ do_action( 'admin_print_styles' );
/** * Fires when scripts are printed for a specific admin page based on $hook_suffix. * * @since 2.1.0 */ do_action( "admin_print_scripts-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
/** * Fires when scripts are printed for all admin pages. * * @since 2.1.0 */ do_action( 'admin_print_scripts' );
/** * Fires in head section for a specific admin page. * * The dynamic portion of the hook name, `$hook_suffix`, refers to the hook suffix * for the admin page. * * @since 2.1.0 */ do_action( "admin_head-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
/** * Fires in head section for all admin pages. * * @since 2.1.0 */ do_action( 'admin_head' );
// Print a CSS class to make PHP errors visible. if ( $error_get_last && WP_DEBUG && WP_DEBUG_DISPLAY && ini_get( 'display_errors' ) // Don't print the class for PHP notices in wp-config.php, as they happen before WP_DEBUG takes effect, // and should not be displayed with the `error_reporting` level previously set in wp-load.php. && ( E_NOTICE !== $error_get_last['type'] || 'wp-config.php' !== wp_basename( $error_get_last['file'] ) ) ) { $admin_body_class .= ' php-error'; }
unset( $error_get_last );
?> </head> <?php /** * Filters the CSS classes for the body tag in the admin. * * This filter differs from the {@see 'post_class'} and {@see 'body_class'} filters * in two important ways: * * 1. `$classes` is a space-separated string of class names instead of an array. * 2. Not all core admin classes are filterable, notably: wp-admin, wp-core-ui, * and no-js cannot be removed. * * @since 2.3.0 * * @param string $classes Space-separated list of CSS classes. */ $admin_body_classes = apply_filters( 'admin_body_class', '' ); $admin_body_classes = ltrim( $admin_body_classes . ' ' . $admin_body_class ); ?> <body class="wp-admin wp-core-ui no-js <?php echo esc_attr( $admin_body_classes ); ?>"> <script type="text/javascript"> document.body.className = document.body.className.replace('no-js','js'); </script>
<?php // Make sure the customize body classes are correct as early as possible. if ( current_user_can( 'customize' ) ) { wp_customize_support_script(); } ?>