wppaste
WordPress

apply_filters( 'password_change_email', array $pass_change_email, array $user, array $userdata )

Since
4.3.0
Filters the contents of the email sent when the user's password is changed.

Compatibility

WordPress
since 4.3.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$pass_change_emailarray
{ Used to build wp_mail().
@type string $to The intended recipients. Add emails in a comma separated string.
@type string $subject The subject of the email.
@type string $message The content of the email.
The following strings have a special meaning and will get replaced dynamically:
- ###USERNAME### The current user's username.
- ###ADMIN_EMAIL### The admin email in case this was unexpected.
- ###EMAIL### The user's email address.
- ###SITENAME### The name of the site.
- ###SITEURL### The URL to the site.
@type string $headers Headers. Add headers in a newline (\r\n) separated string.
}
  • $tostring

    The intended recipients. Add emails in a comma separated string.
  • $subjectstring

    The subject of the email.
  • $messagestring

    The content of the email. The following strings have a special meaning and will get replaced dynamically:
    • ###USERNAME### The current user's username
    • ###ADMIN_EMAIL### The admin email in case this was unexpected
    • ###EMAIL### The user's email address
    • ###SITENAME### The name of the site
    • ###SITEURL### The URL to the site
  • $headersstring

    Headers. Add headers in a newline (\r\n) separated string.
$userarray
The original user array.
$userdataarray
The updated user array.

Where this hook fires · 1

  • wp-includes/user.php:2704wp_update_user()

Source code

		 *         - ###SITEURL###     The URL to the site.		 *     @type string $headers Headers. Add headers in a newline (\r\n) separated string.		 * }		 * @param array $user     The original user array.		 * @param array $userdata The updated user array.		 */		$pass_change_email = apply_filters( 'password_change_email', $pass_change_email, $user, $userdata ); 		$pass_change_email['message'] = str_replace( '###USERNAME###', $user['user_login'], $pass_change_email['message'] );		$pass_change_email['message'] = str_replace( '###ADMIN_EMAIL###', get_option( 'admin_email' ), $pass_change_email['message'] );		$pass_change_email['message'] = str_replace( '###EMAIL###', $user['user_email'], $pass_change_email['message'] );		$pass_change_email['message'] = str_replace( '###SITENAME###', $blog_name, $pass_change_email['message'] );		$pass_change_email['message'] = str_replace( '###SITEURL###', home_url(), $pass_change_email['message'] );

Changelog

Introduced in 4.3.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 6.7.7 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.