allow_password_reset
Filters whether to allow a password to be reset.
Usage
add_filter( 'allow_password_reset', 'wp_kama_allow_password_reset_filter', 10, 2 );
/**
* Function for `allow_password_reset` filter-hook.
*
* @param bool $allow Whether to allow the password to be reset.
* @param int $user_id The ID of the user attempting to reset a password.
*
* @return bool
*/
function wp_kama_allow_password_reset_filter( $allow, $user_id ){
// filter...
return $allow;
}
- $allow(true|false)
- Whether to allow the password to be reset.
Default: true - $user_id(int)
- The ID of the user attempting to reset a password.
Changelog
| Since 2.7.0 | Introduced. |
Where the hook is called
allow_password_reset
wp-includes/user.php 5231
return apply_filters( 'allow_password_reset', $allow, $user->ID );