Created
February 17, 2022 19:24
-
-
Save afragen/5c79984f154911be171c80468f676572 to your computer and use it in GitHub Desktop.
Single use plugin and filter showing how to change WP Debugging default constants.
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 | |
/** | |
* Plugin Name: Change WP Debugging Defaults | |
* Plugin URI: https://gist.github.com/afragen/5c79984f154911be171c80468f676572 | |
* Description: Single use plugin and filter showing how to change WP Debugging default constants. | |
* Version: 0.1 | |
* Author: Andy Fragen | |
* License: MIT | |
* Requires at least: 5.2 | |
* Requires PHP: 7.1 | |
* Gist Plugin URI: https://gist.github.com/afragen/5c79984f154911be171c80468f676572 | |
*/ | |
add_filter( | |
'wp_debugging_add_constants', | |
function ( $added_constants ) { | |
$my_constants = [ | |
'WP_DEBUG_DISPLAY' => [ 'value' => 'false' ], | |
'SCRIPT_DEBUG' => [ 'value' => 'false'], | |
]; | |
return array_merge( $added_constants, $my_constants ); | |
}, | |
10, | |
1 | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment