danemorgan
9/1/2013 - 6:59 PM

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

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;