Last active
September 1, 2017 09:14
-
-
Save Pebblo/8787f5530ea777c84aaf62f075e55b32 to your computer and use it in GitHub Desktop.
Snippet to enable WP_DEBUG but log the errors rather than display them on the page.
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 //Do not include the opening PHP tag | |
//This code enabled WP Debug but disables display_errors so they are not shown on the page. | |
//Any errors thrown on your site will be stored within a debug.log file within /wp-content/ | |
define('WP_DEBUG', true); | |
if ( WP_DEBUG ) { | |
@error_reporting( E_ALL ); | |
@ini_set( 'log_errors', true ); | |
@ini_set( 'log_errors_max_len', '0' ); | |
define( 'WP_DEBUG_LOG', true ); | |
define( 'WP_DEBUG_DISPLAY', false); | |
//define( 'CONCATENATE_SCRIPTS', false ); | |
//define( 'SAVEQUERIES', true ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment