Created
March 16, 2026 18:13
-
-
Save dhirenpatel22/a7ce04a8e7de5f5de38455d3c8c4b25e to your computer and use it in GitHub Desktop.
WordPress Smart Debug
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * WordPress Debug Configuration | |
| * | |
| * This file handles WordPress debug settings based on the 'debug' GET parameter. | |
| * It sets up WP_DEBUG constants and error display settings. | |
| * | |
| * @package WordPress | |
| * @subpackage Configuration | |
| */ | |
| // Check if debug parameter is set to 'true' in the URL | |
| if ( isset( $_GET['debug'] ) && $_GET['debug'] === 'true' ) { | |
| // Enable WordPress debug mode with errors displayed | |
| // This is useful for development and troubleshooting | |
| define( 'WP_DEBUG', true ); | |
| } else { | |
| // Enable WordPress debug mode but hide errors from display | |
| // Errors will be logged to wp-content/debug.log instead | |
| define( 'WP_DEBUG', true ); | |
| define( 'WP_DEBUG_DISPLAY', false ); | |
| // Suppress PHP error display in the browser | |
| @ini_set( 'display_errors', 0 ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment