Filter hook 'send_retrieve_password_email'

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

View Source

send_retrieve_password_email

Filter Hook
Description
Filters whether to send the retrieve password email. Return false to disable sending the email.

Hook Information

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

Hook Parameters

Type Name Description
bool $send Whether to send the email.
string $user_login The username for the user.
WP_User $user_data WP_User object.

Usage Examples

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

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

Source Code Context

wp-includes/user.php:3260 - How this hook is used in WordPress core
<?php
3255  	 *
3256  	 * @param bool    $send       Whether to send the email.
3257  	 * @param string  $user_login The username for the user.
3258  	 * @param WP_User $user_data  WP_User object.
3259  	 */
3260  	if ( ! apply_filters( 'send_retrieve_password_email', true, $user_login, $user_data ) ) {
3261  		return true;
3262  	}
3263  
3264  	// Redefining user_login ensures we return the right case in the email.
3265  	$user_login = $user_data->user_login;

PHP Documentation

<?php
/**
	 * Filters whether to send the retrieve password email.
	 *
	 * Return false to disable sending the email.
	 *
	 * @since 6.0.0
	 *
	 * @param bool    $send       Whether to send the email.
	 * @param string  $user_login The username for the user.
	 * @param WP_User $user_data  WP_User object.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 3
  • File: wp-includes/user.php
Related Hooks

Related hooks will be displayed here in future updates.