Edit File by line
/home/barbar84/www/wp-admin
File: admin-header.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* WordPress Administration Template Header
[2] Fix | Delete
*
[3] Fix | Delete
* @package WordPress
[4] Fix | Delete
* @subpackage Administration
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
[8] Fix | Delete
if ( ! defined( 'WP_ADMIN' ) ) {
[9] Fix | Delete
require_once __DIR__ . '/admin.php';
[10] Fix | Delete
}
[11] Fix | Delete
[12] Fix | Delete
/**
[13] Fix | Delete
* In case admin-header.php is included in a function.
[14] Fix | Delete
*
[15] Fix | Delete
* @global string $title
[16] Fix | Delete
* @global string $hook_suffix
[17] Fix | Delete
* @global WP_Screen $current_screen WordPress current screen object.
[18] Fix | Delete
* @global WP_Locale $wp_locale WordPress date and time locale object.
[19] Fix | Delete
* @global string $pagenow
[20] Fix | Delete
* @global string $update_title
[21] Fix | Delete
* @global int $total_update_count
[22] Fix | Delete
* @global string $parent_file
[23] Fix | Delete
*/
[24] Fix | Delete
global $title, $hook_suffix, $current_screen, $wp_locale, $pagenow,
[25] Fix | Delete
$update_title, $total_update_count, $parent_file;
[26] Fix | Delete
[27] Fix | Delete
// Catch plugins that include admin-header.php before admin.php completes.
[28] Fix | Delete
if ( empty( $current_screen ) ) {
[29] Fix | Delete
set_current_screen();
[30] Fix | Delete
}
[31] Fix | Delete
[32] Fix | Delete
get_admin_page_title();
[33] Fix | Delete
$title = strip_tags( $title );
[34] Fix | Delete
[35] Fix | Delete
if ( is_network_admin() ) {
[36] Fix | Delete
/* translators: Network admin screen title. %s: Network title. */
[37] Fix | Delete
$admin_title = sprintf( __( 'Network Admin: %s' ), get_network()->site_name );
[38] Fix | Delete
} elseif ( is_user_admin() ) {
[39] Fix | Delete
/* translators: User dashboard screen title. %s: Network title. */
[40] Fix | Delete
$admin_title = sprintf( __( 'User Dashboard: %s' ), get_network()->site_name );
[41] Fix | Delete
} else {
[42] Fix | Delete
$admin_title = get_bloginfo( 'name' );
[43] Fix | Delete
}
[44] Fix | Delete
[45] Fix | Delete
if ( $admin_title === $title ) {
[46] Fix | Delete
/* translators: Admin screen title. %s: Admin screen name. */
[47] Fix | Delete
$admin_title = sprintf( __( '%s &#8212; WordPress' ), $title );
[48] Fix | Delete
} else {
[49] Fix | Delete
/* translators: Admin screen title. 1: Admin screen name, 2: Network or site name. */
[50] Fix | Delete
$admin_title = sprintf( __( '%1$s &lsaquo; %2$s &#8212; WordPress' ), $title, $admin_title );
[51] Fix | Delete
}
[52] Fix | Delete
[53] Fix | Delete
if ( wp_is_recovery_mode() ) {
[54] Fix | Delete
/* translators: %s: Admin screen title. */
[55] Fix | Delete
$admin_title = sprintf( __( 'Recovery Mode &#8212; %s' ), $admin_title );
[56] Fix | Delete
}
[57] Fix | Delete
[58] Fix | Delete
/**
[59] Fix | Delete
* Filters the title tag content for an admin page.
[60] Fix | Delete
*
[61] Fix | Delete
* @since 3.1.0
[62] Fix | Delete
*
[63] Fix | Delete
* @param string $admin_title The page title, with extra context added.
[64] Fix | Delete
* @param string $title The original page title.
[65] Fix | Delete
*/
[66] Fix | Delete
$admin_title = apply_filters( 'admin_title', $admin_title, $title );
[67] Fix | Delete
[68] Fix | Delete
wp_user_settings();
[69] Fix | Delete
[70] Fix | Delete
_wp_admin_html_begin();
[71] Fix | Delete
?>
[72] Fix | Delete
<title><?php echo esc_html( $admin_title ); ?></title>
[73] Fix | Delete
<?php
[74] Fix | Delete
[75] Fix | Delete
wp_enqueue_style( 'colors' );
[76] Fix | Delete
wp_enqueue_script( 'utils' );
[77] Fix | Delete
wp_enqueue_script( 'svg-painter' );
[78] Fix | Delete
[79] Fix | Delete
$admin_body_class = preg_replace( '/[^a-z0-9_-]+/i', '-', $hook_suffix );
[80] Fix | Delete
?>
[81] Fix | Delete
<script type="text/javascript">
[82] Fix | Delete
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();}}};
[83] Fix | Delete
var ajaxurl = '<?php echo esc_js( admin_url( 'admin-ajax.php', 'relative' ) ); ?>',
[84] Fix | Delete
pagenow = '<?php echo esc_js( $current_screen->id ); ?>',
[85] Fix | Delete
typenow = '<?php echo esc_js( $current_screen->post_type ); ?>',
[86] Fix | Delete
adminpage = '<?php echo esc_js( $admin_body_class ); ?>',
[87] Fix | Delete
thousandsSeparator = '<?php echo esc_js( $wp_locale->number_format['thousands_sep'] ); ?>',
[88] Fix | Delete
decimalPoint = '<?php echo esc_js( $wp_locale->number_format['decimal_point'] ); ?>',
[89] Fix | Delete
isRtl = <?php echo (int) is_rtl(); ?>;
[90] Fix | Delete
</script>
[91] Fix | Delete
<?php
[92] Fix | Delete
[93] Fix | Delete
/**
[94] Fix | Delete
* Enqueue scripts for all admin pages.
[95] Fix | Delete
*
[96] Fix | Delete
* @since 2.8.0
[97] Fix | Delete
*
[98] Fix | Delete
* @param string $hook_suffix The current admin page.
[99] Fix | Delete
*/
[100] Fix | Delete
do_action( 'admin_enqueue_scripts', $hook_suffix );
[101] Fix | Delete
[102] Fix | Delete
/**
[103] Fix | Delete
* Fires when styles are printed for a specific admin page based on $hook_suffix.
[104] Fix | Delete
*
[105] Fix | Delete
* @since 2.6.0
[106] Fix | Delete
*/
[107] Fix | Delete
do_action( "admin_print_styles-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
[108] Fix | Delete
[109] Fix | Delete
/**
[110] Fix | Delete
* Fires when styles are printed for all admin pages.
[111] Fix | Delete
*
[112] Fix | Delete
* @since 2.6.0
[113] Fix | Delete
*/
[114] Fix | Delete
do_action( 'admin_print_styles' );
[115] Fix | Delete
[116] Fix | Delete
/**
[117] Fix | Delete
* Fires when scripts are printed for a specific admin page based on $hook_suffix.
[118] Fix | Delete
*
[119] Fix | Delete
* @since 2.1.0
[120] Fix | Delete
*/
[121] Fix | Delete
do_action( "admin_print_scripts-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
[122] Fix | Delete
[123] Fix | Delete
/**
[124] Fix | Delete
* Fires when scripts are printed for all admin pages.
[125] Fix | Delete
*
[126] Fix | Delete
* @since 2.1.0
[127] Fix | Delete
*/
[128] Fix | Delete
do_action( 'admin_print_scripts' );
[129] Fix | Delete
[130] Fix | Delete
/**
[131] Fix | Delete
* Fires in head section for a specific admin page.
[132] Fix | Delete
*
[133] Fix | Delete
* The dynamic portion of the hook, `$hook_suffix`, refers to the hook suffix
[134] Fix | Delete
* for the admin page.
[135] Fix | Delete
*
[136] Fix | Delete
* @since 2.1.0
[137] Fix | Delete
*/
[138] Fix | Delete
do_action( "admin_head-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
[139] Fix | Delete
[140] Fix | Delete
/**
[141] Fix | Delete
* Fires in head section for all admin pages.
[142] Fix | Delete
*
[143] Fix | Delete
* @since 2.1.0
[144] Fix | Delete
*/
[145] Fix | Delete
do_action( 'admin_head' );
[146] Fix | Delete
[147] Fix | Delete
if ( 'f' === get_user_setting( 'mfold' ) ) {
[148] Fix | Delete
$admin_body_class .= ' folded';
[149] Fix | Delete
}
[150] Fix | Delete
[151] Fix | Delete
if ( ! get_user_setting( 'unfold' ) ) {
[152] Fix | Delete
$admin_body_class .= ' auto-fold';
[153] Fix | Delete
}
[154] Fix | Delete
[155] Fix | Delete
if ( is_admin_bar_showing() ) {
[156] Fix | Delete
$admin_body_class .= ' admin-bar';
[157] Fix | Delete
}
[158] Fix | Delete
[159] Fix | Delete
if ( is_rtl() ) {
[160] Fix | Delete
$admin_body_class .= ' rtl';
[161] Fix | Delete
}
[162] Fix | Delete
[163] Fix | Delete
if ( $current_screen->post_type ) {
[164] Fix | Delete
$admin_body_class .= ' post-type-' . $current_screen->post_type;
[165] Fix | Delete
}
[166] Fix | Delete
[167] Fix | Delete
if ( $current_screen->taxonomy ) {
[168] Fix | Delete
$admin_body_class .= ' taxonomy-' . $current_screen->taxonomy;
[169] Fix | Delete
}
[170] Fix | Delete
[171] Fix | Delete
$admin_body_class .= ' branch-' . str_replace( array( '.', ',' ), '-', (float) get_bloginfo( 'version' ) );
[172] Fix | Delete
$admin_body_class .= ' version-' . str_replace( '.', '-', preg_replace( '/^([.0-9]+).*/', '$1', get_bloginfo( 'version' ) ) );
[173] Fix | Delete
$admin_body_class .= ' admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'fresh' );
[174] Fix | Delete
$admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) );
[175] Fix | Delete
[176] Fix | Delete
if ( wp_is_mobile() ) {
[177] Fix | Delete
$admin_body_class .= ' mobile';
[178] Fix | Delete
}
[179] Fix | Delete
[180] Fix | Delete
if ( is_multisite() ) {
[181] Fix | Delete
$admin_body_class .= ' multisite';
[182] Fix | Delete
}
[183] Fix | Delete
[184] Fix | Delete
if ( is_network_admin() ) {
[185] Fix | Delete
$admin_body_class .= ' network-admin';
[186] Fix | Delete
}
[187] Fix | Delete
[188] Fix | Delete
$admin_body_class .= ' no-customize-support no-svg';
[189] Fix | Delete
[190] Fix | Delete
if ( $current_screen->is_block_editor() ) {
[191] Fix | Delete
// Default to is-fullscreen-mode to avoid jumps in the UI.
[192] Fix | Delete
$admin_body_class .= ' block-editor-page is-fullscreen-mode wp-embed-responsive';
[193] Fix | Delete
}
[194] Fix | Delete
[195] Fix | Delete
$error_get_last = error_get_last();
[196] Fix | Delete
[197] Fix | Delete
// Print a CSS class to make PHP errors visible.
[198] Fix | Delete
if ( $error_get_last && WP_DEBUG && WP_DEBUG_DISPLAY && ini_get( 'display_errors' )
[199] Fix | Delete
// Don't print the class for PHP notices in wp-config.php, as they happen before WP_DEBUG takes effect,
[200] Fix | Delete
// and should not be displayed with the `error_reporting` level previously set in wp-load.php.
[201] Fix | Delete
&& ( E_NOTICE !== $error_get_last['type'] || 'wp-config.php' !== wp_basename( $error_get_last['file'] ) )
[202] Fix | Delete
) {
[203] Fix | Delete
$admin_body_class .= ' php-error';
[204] Fix | Delete
}
[205] Fix | Delete
[206] Fix | Delete
unset( $error_get_last );
[207] Fix | Delete
[208] Fix | Delete
?>
[209] Fix | Delete
</head>
[210] Fix | Delete
<?php
[211] Fix | Delete
/**
[212] Fix | Delete
* Filters the CSS classes for the body tag in the admin.
[213] Fix | Delete
*
[214] Fix | Delete
* This filter differs from the {@see 'post_class'} and {@see 'body_class'} filters
[215] Fix | Delete
* in two important ways:
[216] Fix | Delete
*
[217] Fix | Delete
* 1. `$classes` is a space-separated string of class names instead of an array.
[218] Fix | Delete
* 2. Not all core admin classes are filterable, notably: wp-admin, wp-core-ui,
[219] Fix | Delete
* and no-js cannot be removed.
[220] Fix | Delete
*
[221] Fix | Delete
* @since 2.3.0
[222] Fix | Delete
*
[223] Fix | Delete
* @param string $classes Space-separated list of CSS classes.
[224] Fix | Delete
*/
[225] Fix | Delete
$admin_body_classes = apply_filters( 'admin_body_class', '' );
[226] Fix | Delete
$admin_body_classes = ltrim( $admin_body_classes . ' ' . $admin_body_class );
[227] Fix | Delete
?>
[228] Fix | Delete
<body class="wp-admin wp-core-ui no-js <?php echo $admin_body_classes; ?>">
[229] Fix | Delete
<script type="text/javascript">
[230] Fix | Delete
document.body.className = document.body.className.replace('no-js','js');
[231] Fix | Delete
</script>
[232] Fix | Delete
[233] Fix | Delete
<?php
[234] Fix | Delete
// Make sure the customize body classes are correct as early as possible.
[235] Fix | Delete
if ( current_user_can( 'customize' ) ) {
[236] Fix | Delete
wp_customize_support_script();
[237] Fix | Delete
}
[238] Fix | Delete
?>
[239] Fix | Delete
[240] Fix | Delete
<div id="wpwrap">
[241] Fix | Delete
<?php require ABSPATH . 'wp-admin/menu-header.php'; ?>
[242] Fix | Delete
<div id="wpcontent">
[243] Fix | Delete
[244] Fix | Delete
<?php
[245] Fix | Delete
/**
[246] Fix | Delete
* Fires at the beginning of the content section in an admin page.
[247] Fix | Delete
*
[248] Fix | Delete
* @since 3.0.0
[249] Fix | Delete
*/
[250] Fix | Delete
do_action( 'in_admin_header' );
[251] Fix | Delete
?>
[252] Fix | Delete
[253] Fix | Delete
<div id="wpbody" role="main">
[254] Fix | Delete
<?php
[255] Fix | Delete
unset( $blog_name, $total_update_count, $update_title );
[256] Fix | Delete
[257] Fix | Delete
$current_screen->set_parentage( $parent_file );
[258] Fix | Delete
[259] Fix | Delete
?>
[260] Fix | Delete
[261] Fix | Delete
<div id="wpbody-content">
[262] Fix | Delete
<?php
[263] Fix | Delete
[264] Fix | Delete
$current_screen->render_screen_meta();
[265] Fix | Delete
[266] Fix | Delete
if ( is_network_admin() ) {
[267] Fix | Delete
/**
[268] Fix | Delete
* Prints network admin screen notices.
[269] Fix | Delete
*
[270] Fix | Delete
* @since 3.1.0
[271] Fix | Delete
*/
[272] Fix | Delete
do_action( 'network_admin_notices' );
[273] Fix | Delete
} elseif ( is_user_admin() ) {
[274] Fix | Delete
/**
[275] Fix | Delete
* Prints user admin screen notices.
[276] Fix | Delete
*
[277] Fix | Delete
* @since 3.1.0
[278] Fix | Delete
*/
[279] Fix | Delete
do_action( 'user_admin_notices' );
[280] Fix | Delete
} else {
[281] Fix | Delete
/**
[282] Fix | Delete
* Prints admin screen notices.
[283] Fix | Delete
*
[284] Fix | Delete
* @since 3.1.0
[285] Fix | Delete
*/
[286] Fix | Delete
do_action( 'admin_notices' );
[287] Fix | Delete
}
[288] Fix | Delete
[289] Fix | Delete
/**
[290] Fix | Delete
* Prints generic admin screen notices.
[291] Fix | Delete
*
[292] Fix | Delete
* @since 3.1.0
[293] Fix | Delete
*/
[294] Fix | Delete
do_action( 'all_admin_notices' );
[295] Fix | Delete
[296] Fix | Delete
if ( 'options-general.php' === $parent_file ) {
[297] Fix | Delete
require ABSPATH . 'wp-admin/options-head.php';
[298] Fix | Delete
}
[299] Fix | Delete
[300] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function