How to stop unwanted PHP Notice
-
I have been plagued with PHP Notice messages cluttering up error_log, and I finally figured out the problem. The _doing_it_wrong function in functions.php doesn’t test for E_NOTICE. The fix is very simple:
if ( WP_DEBUG && (error_reporting() & E_NOTICE) && apply_filters( ‘doing_it_wrong_trigger_error’, true ) ) {
A similar fix gets rid of E_DEPRECATED messages in the _deprecated_argument function.
- The topic ‘How to stop unwanted PHP Notice’ is closed to new replies.