Skip to content

Instantly share code, notes, and snippets.

@bstonedev
Last active May 8, 2023 20:10
Show Gist options
  • Save bstonedev/8cd4d3b7de3cd0933934111dd3d45e10 to your computer and use it in GitHub Desktop.
Save bstonedev/8cd4d3b7de3cd0933934111dd3d45e10 to your computer and use it in GitHub Desktop.
custom-debug-logic.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.
*/
define('WP_DEBUG', true);
if( isset($_GET['debug']) && str_contains($_SERVER['SERVER_NAME'], "stonedigital.dev") ) {
// Only allow debug toggle in staging websites
define('WP_DEBUG_DISPLAY', true);
} else {
define('WP_DEBUG_DISPLAY', false);
}
define( 'WP_DEBUG_LOG', 'wp-content/debug-' . date('Y-m-d') . '-dev.log' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment