Should setting WP_DEBUG_DISPLAY to false ALWAYS hide PHP messages?
-
Hello. This documentation page indicates that if I have the following set in wp-config.php file, no PHP messages will display to the screen:
define(' WP_DEBUG', false ); define( 'WP_DEBUG_DISPLAY', false ); define( 'WP_DEBUG_LOG', false );Am I understanding that correctly? In other words, can I set WP_DEBUG_DISPLAY to false and expect PHP messages to *never* display on-screen? I ask because on three separate sites, this has not been the case. Most recently, I had a site that displayed both a PHP warning and a PHP fatal error to the screen. On another site, it printed PHP warnings to the screen (screenshot).
In that latter case, the warning was in reference to a WordPress core file, but displayed in a Slider Revolution slider. I asked the developers of Slider Revolution and they didn’t know why the warnings were printed. But they told me to add additional code to wp-config to suppress them:
ini_set('display_errors','Off'); ini_set('error_reporting', E_ALL );That code did indeed suppress the warnings. I also asked my web host (SiteGround) and they said the same thing: they don’t know why WP_DEBUG_DISPLAY doesn’t suppress the warnings, but they always add the extra ini_set lines to wp-config.
Also in that case, the issue was present on my live site, but not on my staging site (which is on another server—not with SiteGround) nor on my local development site.
The topic ‘Should setting WP_DEBUG_DISPLAY to false ALWAYS hide PHP messages?’ is closed to new replies.