Skip to content

Instantly share code, notes, and snippets.

@karlazz
Last active August 29, 2015 14:14
Show Gist options
  • Select an option

  • Save karlazz/d6330b8192c413259452 to your computer and use it in GitHub Desktop.

Select an option

Save karlazz/d6330b8192c413259452 to your computer and use it in GitHub Desktop.
enhance wp-config to easily toggle debugging
if (isset($_GET['debug']) ) {
define('WP_DEBUG',true);
if ( $_GET['debug']=='log') {
// Enable Debug logging to the /wp-content/debug.log file
// The web user will have to have write permission to the file
/* uncomment next to use wordpress file default of wp-content/debug.log, make sure of write permission */
//define('WP_DEBUG_LOG', true);
/* or use a file in the wp-content/uploads directory, which should always have write perms on it */
@ini_set('error_log', dirname(__FILE__) . '/wp-content/uploads/debug.log');
// Disable display of errors and warnings
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors',0);
}
}
else
define('WP_DEBUG', false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment