Control verbosity level of WP DEBUG?

When WP_DEBUG is set, WordPress sets (via wp_debug_mode() call early in core load process) the error reporting level to E_ALL & ~E_DEPRECATED & ~E_STRICT. This means all warnings and errors except strict errors and PHP deprecated functions (not WordPress ones). You can define your own level in a custom mu-plugin (the override needs to be … Read more

How to fix the admin menu margin-top bug in WordPress 5.5?

I ran into that issue too, and it turns out that it was because there actually was an error that wasn’t displaying. Once I fixed that underlying error, the top margin problem went away. This is in wp-admin/admin-header.php: // Print a CSS class to make PHP errors visible. if ( error_get_last() && WP_DEBUG && WP_DEBUG_DISPLAY … Read more

Does the functions.php file ever get called during an AJAX call? Debug AJAX

admin-ajax.php loads wp-load.php: /** Load WordPress Bootstrap */ require_once( dirname( dirname( __FILE__ ) ) . ‘/wp-load.php’ ); wp-load.php loads wp-config.php, and there wp-settings.php is loaded. And here we find this: // Load the functions for the active theme, for both parent and child theme if applicable. if ( ! defined( ‘WP_INSTALLING’ ) || ‘wp-activate.php’ === … Read more

Is it possible to change the log file location for WP_DEBUG_LOG?

It turns out that all WP_DEBUG_LOG does is: ini_set( ‘log_errors’, 1 ); ini_set( ‘error_log’, WP_CONTENT_DIR . ‘/debug.log’ ); So, if you want to change the log location for WP_DEBUG_LOG in a plugin or theme, webaware’s answer is best. If you just want to have it changed within wp-config.php you can replace define( ‘WP_DEBUG_LOG’, true ); … Read more