Skip to content

Instantly share code, notes, and snippets.

@sambody
Forked from rohmann/wp-debug-logging.php
Created September 30, 2013 07:58
Show Gist options
  • Save sambody/6760637 to your computer and use it in GitHub Desktop.
Save sambody/6760637 to your computer and use it in GitHub Desktop.
define('WP_DEBUG', true);
/**
* When debug mode is enabled, you can enable logging to store errors in wp-content/debug.log
* This is useful for finding errors that might not get displayed on screen
*
* The next conditional section will make sure errors are not shown to users when logging is enabled
* This helps with quick troubleshooting on live sites
*/
define('WP_DEBUG_LOG', true);
if(defined('WP_DEBUG_LOG') && WP_DEBUG_LOG == true) {
@ini_set('display_errors',0); //Prevent PHP from displaying errors
define('WP_DEBUG_DISPLAY', false); //Prevent Wordpress errors from being displayed
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment