Skip to content

Instantly share code, notes, and snippets.

@strangerstudios
Created June 15, 2017 14:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save strangerstudios/e6c8c3f062ec90b815fc194ce577d66b to your computer and use it in GitHub Desktop.
Save strangerstudios/e6c8c3f062ec90b815fc194ce577d66b to your computer and use it in GitHub Desktop.
Enable/disable WP_DEBUG by adding a debug=1 param to any URL
//add this to your wp-config.php file
session_start();
if(!empty($_REQUEST['debug']) || !empty($_SESSION['WP_DEBUG'])) {
define('WP_DEBUG', true);
//define('WP_DEBUG_LOG', true);
$_SESSION['WP_DEBUG'] = true;
} elseif(isset($_REQUEST['debug'])) {
define('WP_DEBUG', false);
unset($_SESSION['WP_DEBUG']);
} else {
define('WP_DEBUG', false);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment