From 8eab1eb9a9a43070ef58bfa15bff26886e239ffb Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Sat, 2 May 2020 20:59:31 +0000 Subject: [PATCH] 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 --- src/wp-admin/admin-header.php | 5 +++++ src/wp-admin/css/admin-menu.css | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/src/wp-admin/admin-header.php b/src/wp-admin/admin-header.php index c6760f9b86..75ff053154 100644 --- a/src/wp-admin/admin-header.php +++ b/src/wp-admin/admin-header.php @@ -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'; +} + ?>