Skip to content
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

Closed
wants to merge 1 commit into from
Closed

feat: add disable notification about admin email changed #452

wants to merge 1 commit into from

Conversation

Kuzry
Copy link
Contributor

@Kuzry Kuzry commented Aug 29, 2023

No description provided.

@jakubmikita
Copy link
Member

@@ -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 );
Copy link
Contributor Author

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?

Copy link
Contributor Author

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

Copy link
Member

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

Copy link
Member

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @since 8.0.15
* @since [Next]

Do it this way, the [Next] placeholder will be replaced with the version number upon release

Comment on lines +156 to +160
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' );
}
}
Copy link
Member

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

@jakubmikita
Copy link
Member

@Kuzry can I close this one already?

In favor of #454

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants