Created
August 11, 2014 14:39
-
-
Save joshuadavidnelson/7542fc8029d6b2b657f1 to your computer and use it in GitHub Desktop.
Change the debug settings depending on the environment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Change the debug settings depending on the environment | |
* | |
* Add this to your wp-config file | |
* | |
* @link http://www.paulund.co.uk/debugging-wordpress | |
*/ | |
switch( $_SERVER['SERVER_NAME']) { | |
// Dev | |
case 'dev.example.com': | |
define('WP_DEBUG', true); | |
define('WP_DEBUG_LOG', true); | |
define('ENV', 'dev'); | |
break; | |
// UAT | |
case 'uat.example.com': | |
define('WP_DEBUG', true); | |
define('WP_DEBUG_LOG', true); | |
define('WP_DEBUG_DISPLAY', false); | |
define('ENV', 'uat'); | |
break; | |
// Live | |
case 'live.example.com': | |
define('WP_DEBUG', false); | |
define('ENV', 'live'); | |
break; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment