Skip to content

Instantly share code, notes, and snippets.

@joshuadavidnelson
Created August 11, 2014 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshuadavidnelson/7542fc8029d6b2b657f1 to your computer and use it in GitHub Desktop.
Save joshuadavidnelson/7542fc8029d6b2b657f1 to your computer and use it in GitHub Desktop.
Change the debug settings depending on the environment
<?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