WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to write a if statement into the wp-config.php to only enable define('WP_DEBUG', true); if it's not the main site in a WordPress Multisite install. I just don't know how much of the WordPress codex functions I can call from the config file.

Was thinking

if ( is_main_site($blog_id) ) {
  define('WP_DEBUG', false);
}
else {
 define('WP_DEBUG', true);
}

But I figured I would pick the communities brain on this one.

share|improve this question

Your best bet would be to match $_SERVER['HTTP_HOST'] variable against desired host. Unfortunately wordpress init WP_DEBUG constant before multisite functions are loaded.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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