Users: Add filter to customize email sent on profile email change#9016
Users: Add filter to customize email sent on profile email change#9016SainathPoojary wants to merge 1 commit intoWordPress:trunkfrom
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
| $new_user_email_notification = array( | ||
| 'to' => $_POST['email'], | ||
| /* translators: New email address notification email subject. %s: Site title. */ | ||
| 'subject' => __( '[%s] Email Change Request' ), |
There was a problem hiding this comment.
Where and when the $sitename get replaced by [%s]?
There was a problem hiding this comment.
The $sitename replaces the [%s] placeholder in the subject line at the point of sending the email, during the wp_mail() call. This happens via:
wordpress-develop/src/wp-includes/user.php
Lines 3903 to 3908 in 94d620a
So while the subject is initially defined as '[%s] Email Change Request', the actual replacement occurs just before the email is sent, allowing filters like wp_new_user_notification_email to modify the subject (and other fields) before it’s finalized.
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
Trac ticket: #49046
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.