Skip to content

Instantly share code, notes, and snippets.

@joshuafredrickson
Created April 10, 2024 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshuafredrickson/4d14bf04d872168f55fa0ec901527158 to your computer and use it in GitHub Desktop.
Save joshuafredrickson/4d14bf04d872168f55fa0ec901527158 to your computer and use it in GitHub Desktop.
Change who receives Solid Security notifications based on environment type
<?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 ['newemail@example.org'];
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment