Shoora
4/28/2019 - 12:32 PM

[WordPress] Enable debug mode via URL. Props @bueltge.

[WordPress] Enable debug mode via URL. Props @bueltge.

<?php
/**
 * Better: use nonces, or less obvious query arguments.
 * http://glueckpress.com/?show_me=💩
 */
if ( isset( $_GET['show_me'] ) && $_GET['show_me'] === '💩') {
	define( 'WP_DEBUG', true );
	define( 'WP_DEBUG_DISPLAY', true );
} else {
	define( 'WP_DEBUG', false );
	define( 'WP_DEBUG_DISPLAY', false );
}
define( 'WP_DEBUG_LOG', false );
<?php
/**
 * Debugging via URL paramter.
 * http://example.com/?wp_debug=true
 * 
 * Props @bueltge
 * @link https://github.com/bueltge/WordPress-Starter/blob/master/wp-config.php#L3-L6
 */
if ( isset($_GET['wp_debug']) && $_GET['wp_debug'] === 'true') {
	define( 'WP_DEBUG', true );
} else {
	define( 'WP_DEBUG', false );
}