Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
http://git.io/gJANNQ Enables debug logging for Wordpress.This snippet can be placed in wp-config.php to quickly setup debug logging. Adapted from: http://premium.wpmudev.org/forums/topic/the-right-way-to-debug-php-in-wordpress
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
You can’t perform that action at this time.