Administration: Reduce the chance that a PHP error message that occurs before the admin menu gets output is covered by the admin menu.

Props EmpireOfLight, afercia, Mte90, audrasjb, sunnyratilal

Fixes #35155

git-svn-id: https://develop.svn.wordpress.org/trunk@47745 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn 2020-05-02 20:59:31 +00:00
parent d250cbcfee
commit 8eab1eb9a9
2 changed files with 14 additions and 0 deletions

View File

@ -200,6 +200,11 @@ if ( $current_screen->is_block_editor() ) {
} }
} }
// Print a CSS class to make PHP errors visible.
if ( error_get_last() && WP_DEBUG && WP_DEBUG_DISPLAY && ini_get( 'display_errors' ) ) {
$admin_body_class .= ' php-error';
}
?> ?>
</head> </head>
<?php <?php

View File

@ -13,6 +13,15 @@
z-index: 1; /* positive z-index to avoid elastic scrolling woes in Safari */ z-index: 1; /* positive z-index to avoid elastic scrolling woes in Safari */
} }
.php-error #adminmenuback {
position: absolute;
}
.php-error #adminmenuback,
.php-error #adminmenuwrap {
margin-top: 2em;
}
#adminmenu { #adminmenu {
clear: left; clear: left;
margin: 12px 0; margin: 12px 0;