Skip to content

Instantly share code, notes, and snippets.

@glueckpress
Last active May 13, 2019 13:08
Show Gist options
  • Save glueckpress/c9d401b96140766121e4 to your computer and use it in GitHub Desktop.
Save glueckpress/c9d401b96140766121e4 to your computer and use it in GitHub Desktop.
[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 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment