I’m needing to debug one of my themes and I want to be able to switch on a debug mode so I can output more information or switch off debug mode and not see any information.
I noticed there is a debug variable defined in wp_config.php. I can easily set this to true or false. Is it OK to use this variable for my own debugging purposes or should I create my own?
Also, how do I check for if debug is true? My PHP is a bit rusty. Is this correct:
define('WP_DEBUG', true);
if ($WP_DEBUG) {
// do something
}
My question is different.