Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#39788 closed enhancement (fixed)

Add documentation to the `retrieve_password_message` filter that returning empty messages stops email

Reported by: sudar's profile sudar Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.8 Priority: normal
Severity: normal Version: 4.8
Component: Login and Registration Keywords: has-patch
Focuses: docs Cc:

Description

When a user resets his password, WordPress sents the password reset email.

Both retrieve_password_message and retrieve_password_title filters are exposed to provide plugins an ability to customize the title or message of the password reset emails.

If the retrieve_password_message filter returns an empty string for message, then the email itself is not sent. The code at https://github.com/WordPress/WordPress/blob/master/wp-login.php#L372 checks for this condition.

This is not documented anywhere. We should ideally document it by adding it to the phpdoc block of the filter so that it is reflected in the developer docs.

I am attaching a patch that adds this documentation to the phpdoc block.

Attachments (1)

39788.patch (429 bytes) - added by sudar 7 years ago.

Download all attachments as: .zip

Change History (4)

@sudar
7 years ago

#1 @sudar
7 years ago

  • Keywords has-patch added

Both retrieve_password_message and retrieve_password_title filters are exposed to provide plugins an ability to customize the title or message of the password reset emails.

exposed was a wrong word choice in my above message, since people might associate it with security or vulnerabilities. What I meant was the following.

Both retrieve_password_message and retrieve_password_title filters can be used by plugins to customize the title or message of the password reset emails.

#2 @SergeyBiryukov
7 years ago

  • Milestone changed from Awaiting Review to 4.8

#3 @SergeyBiryukov
7 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 40048:

Docs: Add a note to retrieve_password_message filter that password reset email will not be sent if the filtered message is empty.

Props sudar.
Fixes #39788.

Note: See TracTickets for help on using tickets.