admin管理员组文章数量:1320661
After the recent update of WordPress, version 5.5.1.
Whenever I enabled the debug mode, there is a 2em gap between WordPress admin menu and the bar.
.php-error #adminmenuback, .php-error #adminmenuwrap {
margin-top: 2em;
}
Found out that this is showing because there is a hidden error somewhere on the website?
How I could show that error?
After the recent update of WordPress, version 5.5.1.
Whenever I enabled the debug mode, there is a 2em gap between WordPress admin menu and the bar.
.php-error #adminmenuback, .php-error #adminmenuwrap {
margin-top: 2em;
}
Found out that this is showing because there is a hidden error somewhere on the website?
How I could show that error?
Share Improve this question edited Oct 14, 2020 at 7:23 bueltge 17.1k7 gold badges62 silver badges97 bronze badges asked Oct 14, 2020 at 1:11 MarlonMarlon 318 bronze badges2 Answers
Reset to default 2One way to do that is to enable WP_DEBUG_LOG in wp-config.php
. The file will look like this:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_DISPLAY', false );
define( 'WP_DEBUG_LOG', true ); //You may also set the log file path instead of just true
Defining WP_DEBUG_LOG as true will save logs under wp-content/debug.log
and you'll find the PHP errors there.
---Fix---
That CSS gap will only show when there is a "Hidden" error.
If these conditions are true,
if ( $error && WP_DEBUG && WP_DEBUG_DISPLAY && ini_get( 'display_errors' )
the gap will show, it means that $error variable is not empty, we should show the value in a log file.
To solve this issue, we need to show that hidden error by adding this code..
wp-admin/admin-header.php on line 201
$error = error_get_last();
error_log('===================This is the hidden error==================');
error_log(print_r($error,true));
error_log('=================Error Setting display======================');
error_log('WP_DEBUG');
error_log(print_r(WP_DEBUG ,true));
error_log('WP_DEBUG_DISPLAY');
error_log(print_r(WP_DEBUG_DISPLAY,true));
error_log('display_errors ini setting');
error_log(print_r(ini_get( 'display_errors' ),true));
After checking the debug.log, we can now see and fix the error.
This is related to this issue How to fix the admin menu margin-top bug in WordPress 5.5? and my answer also resolved it...
本文标签: WordPress admin menu gap when debug mode is enabled
版权声明:本文标题:WordPress admin menu gap when debug mode is enabled? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742063101a2418676.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论