Last active
December 22, 2015 02:49
-
-
Save danemorgan/6406484 to your computer and use it in GitHub Desktop.
On demand WordPress debugging display with always on logging. Put this code in your wp-config.php then wen you load a page and something goes wrong reload it with /?debug This is intended for develpment sites.
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 | |
// Turn on logging for dev environment | |
define('WP_DEBUG', true); // or false | |
define('WP_DEBUG_LOG', true); | |
@ini_set('display_errors',0); | |
// Add debugging display on demand through a get variable | |
if ( isset($_GET['debug']) && $_GET['debug'] == 'debug') : | |
define('WP_DEBUG_DISPLAY', true); | |
else : | |
define('WP_DEBUG_DISPLAY', false); | |
endif; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment