-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add disable notification about admin email changed #452
feat: add disable notification about admin email changed #452
Conversation
@@ -91,6 +91,7 @@ | |||
add_action( 'notification/init', [ $this->component( 'integration_wp_emails' ), 'disable_password_change_notify_to_admin' ], 10, 0 ); | |||
add_action( 'notification/init', [ $this->component( 'integration_wp_emails' ), 'disable_send_confirmation_on_profile_email' ], 10, 0 ); | |||
add_action( 'notification/init', [ $this->component( 'integration_wp_emails' ), 'disable_send_confirmation_on_admin_email' ], 10, 0 ); | |||
add_action( 'notification/init', [ $this->component( 'integration_wp_emails' ), 'disable_send_confirmation_on_admin_email_changed' ], 10, 0 ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this place i have two error on command "composer phpstan". In line 92 and 94:
Ignored error pattern #^Parameter \#2 \$callback of function add_action expects callable\(\)\: mixed, array\(mixed, '\S+'\) given\.$# in path... register-hooks.php is expected to occur 81 times, but occurred only 1 time
Is this error significant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And does adding it here matter at all? Because I saw that in the comments we have appropriate notifications
@action notification/init
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh, nice catch with this file! You don't have to bother with that, though :)
It's generated upon the release, as it's just the compatibility dump. The @action
comment is enough for development purposes and in most production cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And the error is not much significant, if that's the only one you can run composer phpstan -- --generate-baseline
to get rid of it
@@ -301,6 +301,7 @@ Yes! We're offering a [custom plugin development](https://bracketspace.com/custo | |||
7. Default email disabler | |||
|
|||
== Changelog == | |||
* [Added] Disable notification about admin email address changed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong place, it should be below the = [Next] =
tag
/** | ||
* Disables send the email change email to user | ||
* | ||
* @filter send_password_change_email | ||
* | ||
* @since 6.1.0 | ||
* @8. 6.1.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A typo presumabely :)
* | ||
* @action notification/init | ||
* | ||
* @since 8.0.15 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @since 8.0.15 | |
* @since [Next] |
Do it this way, the [Next]
placeholder will be replaced with the version number upon release
public function disable_send_confirmation_on_admin_email_changed() { | ||
if ( 'true' === notification_get_setting( 'integration/emails/send_confirmation_on_admin_email_changed' ) ) { | ||
add_filter( 'send_site_admin_email_change_email', '__return_false' ); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong coding standards, and the wrong branch. It should be branched from major
, PR should be back to major
as well
No description provided.