0

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.

0

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.

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.