Optional error level to use with WP_DEBUG
-
Hello.
tl;dr -> Allow PHP error reporting level (which
WP_DEBUGwould use) to be set inwp-config.phpto suppress possible errors betweenwp-config.phpand theafter_setup_themehook.I have a feature request regarding
WP_DEBUGand the level of errors that WordPress spits out whenWP_DEBUGis enabled.In newer PHP version
E_STRICThas been merged withE_ALL, so WordPress begins to reportE_STRICTerrors too. During theme development this is great … until you install a 3rd party plugin with a bit outdated code.The
E_STRICTreports appear usually on each and every page, because plugins are not being loaded “according to strict standards”.I’d rather keep theme related and plugin related strict standards notices separated. Because plugins are seemingly loaded before the
after_setup_theme(the first hook available to hook into fromfunctions.php) I cannot suppress plugin related errors in theme code (I tried various ways of setting theerror_reportingvalue).Setting the error level in
wp-config.phpdoes not work either, as WordPress resets the value inwp-includes/load.php. When WP gets toafter_setup_themethe system has already possibly complained about numerous errors when loading non-theme specific contents.Could an additional PHP constant be created to be used with
WP_DEBUG(e.g.WP_DEBUG_LEVELor similar). This constant would be optional and would default to whatever the current WP version uses. It should be able to be changed inwp-config.php.Thanks.
EDIT: I know how to use mu-plugins, but I personally think this feature could be useful a core addition.
The topic ‘Optional error level to use with WP_DEBUG’ is closed to new replies.