Created
June 15, 2017 14:43
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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