0

I want to make 'WP_DEBUG' true or false from functions.php.
Is it really possible?

  • 2
    You could, but you wouldn't be able to debug anything that happens before the theme is loaded. This includes most of WordPress loading and all plugins loading. You need to put it in 'wp-config.php` so that it's set before anything happens. Also, global debugging is not something themes should control. It's not appropriate, even if it worked. – Jacob Peattie May 22 at 5:14
  • @JacobPeattie Why not post it as an answer? – kero May 22 at 8:51
1

You could, but you wouldn't be able to debug anything that happens before the theme is loaded. This includes most of WordPress loading and all plugins loading. You need to put it in 'wp-config.php` so that it's set before anything happens. Also, global debugging is not something themes should control. It's not appropriate, even if it worked.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.