Created
April 10, 2024 21:59
-
-
Save joshuafredrickson/4d14bf04d872168f55fa0ec901527158 to your computer and use it in GitHub Desktop.
Change who receives Solid Security notifications based on environment type
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: Solid Security configuration | |
* Plugin URI: https://joshuafredrickson.com | |
* Version: 1.0.0 | |
* Description: Filter notifications in non-production environments. | |
* Author: Kinetic | |
* Author URI: https://joshuafredrickson.com | |
* License: GNU General Public License v2 | |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html | |
*/ | |
/** | |
* Change who receives notifications in non-production environments. | |
*/ | |
add_filter('itsec_notification_email_recipients', function (array $emails): array { | |
if (wp_get_environment_type() === 'production') { | |
return $emails; | |
} | |
return ['[email protected]']; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment