Skip to content

Instantly share code, notes, and snippets.

@afragen
Created February 17, 2022 19:24
Show Gist options
  • Save afragen/5c79984f154911be171c80468f676572 to your computer and use it in GitHub Desktop.
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.
<?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