diff --git a/readme.txt b/readme.txt index fbbbd236..5e1f0e53 100644 --- a/readme.txt +++ b/readme.txt @@ -311,6 +311,7 @@ Yes! We're offering a [custom plugin development](https://bracketspace.com/custo * [Changed] Minimum required PHP version from 7.4. * [Changed] WordPress Coding Standards to PSR-12 standards. * [Added] New trigger after user confirms his new email address +* [Added] Option to disable notification about admin email address changed. **Compatibility Breaking Changes** diff --git a/src/Admin/Settings.php b/src/Admin/Settings.php index f0e4551a..ec1db2d2 100644 --- a/src/Admin/Settings.php +++ b/src/Admin/Settings.php @@ -667,6 +667,22 @@ public function emailsSettings($settings) 'sanitize' => [new CoreFields\Checkbox(), 'sanitize'], ] ) + ->addField( + [ + 'name' => __('Admin Email address changed', 'notification'), + 'slug' => 'send_confirmation_on_admin_email_changed', + 'default' => false, + 'addons' => [ + 'label' => __( + 'Disable email to new admin about site email address changed.', + 'notification' + ), + ], + 'description' => __('Email is sent when new site email address is confirmed.', 'notification'), + 'render' => [new CoreFields\Checkbox(), 'input'], + 'sanitize' => [new CoreFields\Checkbox(), 'sanitize'], + ] + ) ->addField( [ 'name' => __('Automatic WordPress core update', 'notification'), diff --git a/src/Integration/WordPressEmails.php b/src/Integration/WordPressEmails.php index f055f1cb..a4101fb3 100644 --- a/src/Integration/WordPressEmails.php +++ b/src/Integration/WordPressEmails.php @@ -186,6 +186,19 @@ public function disableSendConfirmationOnAdminEmail() ); } + /** + * Disables email on admin email address changed + * + * @filter send_site_admin_email_change_email + * + * @since [Next] + * @return bool + */ + public function disableSendConfirmationOnAdminEmailChanged() + { + return getSetting('integration/emails/send_confirmation_on_admin_email_changed') !== 'true'; + } + /** * Disables send the email change email to user *