Skip to content

Instantly share code, notes, and snippets.

@wpsmith
Last active August 25, 2020 20:41
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 wpsmith/22ec50c29488da78b12f45ad0572c59a to your computer and use it in GitHub Desktop.
Save wpsmith/22ec50c29488da78b12f45ad0572c59a to your computer and use it in GitHub Desktop.
WP: Debug configuration for wp-config.php
<?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