Filter hook 'send_password_change_email'

in WP Core File wp-includes/user.php at line 2689

View Source

send_password_change_email

Filter Hook
Description
Filters whether to send the password change email.

Hook Information

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

Hook Parameters

Type Name Description
bool $send Whether to send the email.
array $user The original user array.
array $userdata The updated user array.

Usage Examples

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

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

Source Code Context

wp-includes/user.php:2689 - How this hook is used in WordPress core
<?php
2684  		 *
2685  		 * @param bool  $send     Whether to send the email.
2686  		 * @param array $user     The original user array.
2687  		 * @param array $userdata The updated user array.
2688  		 */
2689  		$send_password_change_email = apply_filters( 'send_password_change_email', true, $user, $userdata );
2690  	}
2691  
2692  	if ( isset( $userdata['user_email'] ) && $user['user_email'] !== $userdata['user_email'] ) {
2693  		/**
2694  		 * Filters whether to send the email change email.

PHP Documentation

<?php
/**
		 * Filters whether to send the password change email.
		 *
		 * @since 4.3.0
		 *
		 * @see wp_insert_user() For `$user` and `$userdata` fields.
		 *
		 * @param bool  $send     Whether to send the email.
		 * @param array $user     The original user array.
		 * @param array $userdata The updated user array.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 3
  • File: wp-includes/user.php
Related Hooks

Related hooks will be displayed here in future updates.