Filter hook 'wp_password_change_notification_email'

in WP Core File wp-includes/pluggable.php at line 2135

View Source

wp_password_change_notification_email

Filter Hook
Description
Filters the contents of the password change notification email sent to the site admin. }

Hook Information

File Location wp-includes/pluggable.php View on GitHub
Hook Type Filter
Line Number 2135

Hook Parameters

Type Name Description
array $wp_password_change_notification_email { Used to build wp_mail().
WP_User $user User object for user whose password was changed.
string $blogname The site title.

Usage Examples

Basic Usage
<?php
// Hook into wp_password_change_notification_email
add_filter('wp_password_change_notification_email', 'my_custom_filter', 10, 3);

function my_custom_filter($wp_password_change_notification_email, $user, $blogname) {
    // Your custom filtering logic here
    return $wp_password_change_notification_email;
}

Source Code Context

wp-includes/pluggable.php:2135 - How this hook is used in WordPress core
<?php
2130  			 *     @type string $headers The headers of the email.
2131  			 * }
2132  			 * @param WP_User $user     User object for user whose password was changed.
2133  			 * @param string  $blogname The site title.
2134  			 */
2135  			$wp_password_change_notification_email = apply_filters( 'wp_password_change_notification_email', $wp_password_change_notification_email, $user, $blogname );
2136  
2137  			wp_mail(
2138  				$wp_password_change_notification_email['to'],
2139  				wp_specialchars_decode( sprintf( $wp_password_change_notification_email['subject'], $blogname ) ),
2140  				$wp_password_change_notification_email['message'],

PHP Documentation

<?php
/**
			 * Filters the contents of the password change notification email sent to the site admin.
			 *
			 * @since 4.9.0
			 *
			 * @param array   $wp_password_change_notification_email {
			 *     Used to build wp_mail().
			 *
			 *     @type string $to      The intended recipient - site admin email address.
			 *     @type string $subject The subject of the email.
			 *     @type string $message The body of the email.
			 *     @type string $headers The headers of the email.
			 * }
			 * @param WP_User $user     User object for user whose password was changed.
			 * @param string  $blogname The site title.
			 */
Quick Info
  • Hook Type: Filter
  • Parameters: 3
  • File: wp-includes/pluggable.php
Related Hooks

Related hooks will be displayed here in future updates.