Skip to content

Instantly share code, notes, and snippets.

@ramiabraham
Last active August 29, 2015 13:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ramiabraham/9358523 to your computer and use it in GitHub Desktop.
Save ramiabraham/9358523 to your computer and use it in GitHub Desktop.
WP_DEBUG via query parameter, WP_DEBUG dev stack
// Allows you to add ?debug=true query parameter
// For live sites in which a dev environment is not possible.
if ( isset($_GET['debug']) && $_GET['debug'] == 'true') {
define('WP_DEBUG', true);
}
// A nice stack recommended by @jjeaton,
// for dev environments:
// Debug Settings
define('WP_DEBUG', true);
if (WP_DEBUG) {
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
define('SAVEQUERIES', true);
define('SCRIPT_DEBUG', true);
@ini_set('display_errors',0);
if ( function_exists( 'xdebug_disable' ) ) {
xdebug_disable();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment