Last active
August 25, 2020 20:41
-
-
Save wpsmith/22ec50c29488da78b12f45ad0572c59a to your computer and use it in GitHub Desktop.
WP: Debug configuration for wp-config.php
This file contains hidden or 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
<?php | |
// Uncomment to enable WP_DEBUG. Of course, you want to change this cookie value to something else. | |
//define( 'WP_DEVELOPER_COOKIE', 'V1AgRGV2ZWxvcGVyIGZvciBkb21haW4uY29tIGRlYnVnZ2luZyBwdXJwb3Nlcy4=' ); | |
// Enable WP DEBUG if debug query parameter exists OR the "wp_developer" cookie exists with a specific value (WP_DEVELOPER_COOKIE). | |
$wp_debug = ( | |
isset( $_GET['debug'] ) || | |
( isset( $_COOKIE['wp_developer'] ) && defined( 'WP_DEVELOPER_COOKIE' ) && $_COOKIE['wp_developer'] == WP_DEVELOPER_COOKIE ) | |
); | |
define( 'WP_DEBUG', $wp_debug ); | |
define( 'WP_DEBUG_LOG', $wp_debug ); | |
define( 'SCRIPT_DEBUG', $wp_debug ); | |
// Enable WP DEBUG_DISPLAY if debug query parameter equals "display". | |
define('WP_DEBUG_DISPLAY', ( $wp_debug && isset( $_GET['debug'] ) && ( 'display' === $_GET['debug'] ) )); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment