Skip to content

Instantly share code, notes, and snippets.

@danemorgan
Last active December 22, 2015 02:49
Show Gist options
  • Save danemorgan/6406484 to your computer and use it in GitHub Desktop.
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.
<?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