According to this question, it's possible to turn on/off WP_DEBUG
for specific sites on a multisite.
Is it possible to do this with a sub-directory multisite?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityAccording to this question, it's possible to turn on/off WP_DEBUG
for specific sites on a multisite.
Is it possible to do this with a sub-directory multisite?
You can do this by adding some code to wp-config.php
$request_uri = $_SERVER['REQUEST_URI'];
$debug_dirs = array ('/debug-dir1/','/debug-dir2/'); // list of directories to turn on debugging
foreach ($debug_dirs as $debug_dir) {
if (!strncmp($request_uri,$debug_dir,strlen($debug_dir))) {
define('WP_DEBUG', true);
}
}
define('WP_DEBUG', false); // debug off by default
Here is what worked for me
$url = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
if (strpos($url,'sitename') !== false) {
define('WP_DEBUG', true);
}