Skip to content

Instantly share code, notes, and snippets.

@mldarshana
Forked from rohmann/wp-debug.php
Last active August 29, 2015 14:08
Show Gist options
  • Save mldarshana/1742e671579479ececc1 to your computer and use it in GitHub Desktop.
Save mldarshana/1742e671579479ececc1 to your computer and use it in GitHub Desktop.
define('WP_DEBUG', true);
if (WP_DEBUG) {
/**
* Log errors to wp-content/debug.log
* Don't forget to delete this when you're finished,
* as it may be publicly accessible.
*/
define('WP_DEBUG_LOG', true);
//Use dev libraries instead of minified versions.
define('SCRIPT_DEBUG', true);
// Log queries so they can be viewed after request. (https://wordpress.org/plugins/debug-bar/)
define('SAVEQUERIES', true);
/**
* Only display errors to users
* Prevents users from being distrubed by errors while you're debugging
* Replace 127.0.0.1 with your IP address, and add as many as you like
*/
if ( in_array( $_SERVER['REMOTE_ADDR'], array( '127.0.0.1', 'more...ips...' ) ) ) {
define('WP_DEBUG_DISPLAY', true);
} else {
define('WP_DEBUG_DISPLAY', false);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment