#38068 closed enhancement (fixed)
Add filters to wp_new_user_notification and wp_password_change_notification
Reported by: | pbearne | Owned by: | johnbillion |
---|---|---|---|
Milestone: | 4.9 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Users | Keywords: | |
Focuses: | Cc: |
Description
There is a filters (retrieve_password_title and retrieve_password_message) to set retrieve password message in wp-login but not for wp_new_user_notification and wp_password_change_notification in pluggable.php this patch adds them
the new filters are
wp_password_change_notification_subject
wp_password_change_notification_message
wp_password_change_notification_headers
wp_new_user_notification_admin_message
wp_new_user_notification_admin_subject
wp_new_user_notification_admin_headers
wp_new_user_notification_message
wp_new_user_notification_subject
wp_new_user_notification_headers
Attachments (8)
Change History (28)
#2
@
8 years ago
Howdy! Thanks for the patch. It's easier for folks to apply/test patches if they are created from the svn root, so the full path (e.g. src/wp-includes/pluggable.php
etc) is part of the patch.
I like this—makes it easier to customize these without having to totally duplicate the functions.
That said, being in pluggable.php, these functions can be wholly overwritten by plugins, making the filters unavailable. I don't see this done in other filters in pluggable.php, but would it makes sense to denote that in the inline documentation?
#3
@
8 years ago
For an example look at wp_notify_moderator() I copied the headers filter to match
I have been working on WP VIP project so can only ship a theme where the client wanted to change the eamil content but I can't replace the pluggable function in a theme as the file sis load before the theme
Yes there will be plugin/code that overloads the function that will not have the filters but any new one and updates can have them. The filter not not been there is not a reason to not add them
will fix patch root I thought is was the dev root
This ticket was mentioned in Slack in #core by pbearne. View the logs.
8 years ago
#5
@
8 years ago
@pbearne Could you check the $message_headers
functionality in your patch please? Looks like at least one occurrence isn't used in wp_mail()
.
This ticket was mentioned in Slack in #core by pbearne. View the logs.
8 years ago
#9
@
8 years ago
Just ran into this. Seems super odd that these filters aren't already in core. Is there anything we can do to get these in 4.7?
#10
@
8 years ago
@jtsternberg ping them on slack in the core channel now would a good time as they doing a meeting where this is decided :-)
#11
@
7 years ago
- Keywords dev-feedback removed
- Milestone changed from Awaiting Review to 4.9
- Owner set to johnbillion
- Status changed from new to reviewing
#13
@
7 years ago
- Keywords needs-patch added; has-patch removed
- Resolution fixed deleted
- Status changed from closed to reopened
It looks like all of the most recently introduced email notifications use one filter on an array of fields for the email (eg. email_change_email
and password_change_email
) instead of separate filters for the subject, content, and headers. This pattern should be followed here.
#15
@
7 years ago
Here you go one patch using an array to pass the values
I noted that the wp_mail for the wp_new_user_notification_email_admin has an @errror prexit I wonder if we can remove it?
paul
#16
@
7 years ago
- Keywords has-patch needs-testing added; needs-patch removed
- Status changed from reopened to reviewing
#17
@
7 years ago
- Keywords needs-dev-note commit added; needs-codex needs-testing removed
38068.2.patch corrects some errors in 38068.patch and makes some further tweaks. This is good to go.
patch