Skip to content

Instantly share code, notes, and snippets.

@GarySwift
Last active March 28, 2017 10:16
Show Gist options
  • Select an option

  • Save GarySwift/dd53acd4b595d04ab7b9b6fc27181e24 to your computer and use it in GitHub Desktop.

Select an option

Save GarySwift/dd53acd4b595d04ab7b9b6fc27181e24 to your computer and use it in GitHub Desktop.
WordPress Debug mode for developing
<?php
/**
* For developers: WordPress debugging mode.
*
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
*
* For information on other constants that can be used for debugging,
* visit the Codex.
*
* @link https://codex.wordpress.org/Debugging_in_WordPress
*/
$debug=true;// Turn on/off Wordpress debugging (and log it in debug.log)
if($debug) {
// Turn debugging on
define('WP_DEBUG', true);
// Tell WordPress to log everything to /wp-content/debug.log
define('WP_DEBUG_LOG', true);
// Turn on the display of error messages on your site
define('WP_DEBUG_DISPLAY', true);
}
else {
define('WP_DEBUG', false);
define('WP_DEBUG_LOG', false);
define('WP_DEBUG_DISPLAY', false);
}
@GarySwift
Copy link
Author

This is the debug settings I use when developing new WordPress sites.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment