Filter hook 'allow_password_reset'

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

View Source

allow_password_reset

Filter Hook
Description
Filters whether to allow a password to be reset.

Hook Information

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

Hook Parameters

Type Name Description
bool $allow Whether to allow the password to be reset. Default true.
int $user_id The ID of the user attempting to reset a password.

Usage Examples

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

function my_custom_filter($allow, $user_id) {
    // Your custom filtering logic here
    return $allow;
}

Source Code Context

wp-includes/user.php:5190 - How this hook is used in WordPress core
<?php
5185  	 * @since 2.7.0
5186  	 *
5187  	 * @param bool $allow   Whether to allow the password to be reset. Default true.
5188  	 * @param int  $user_id The ID of the user attempting to reset a password.
5189  	 */
5190  	return apply_filters( 'allow_password_reset', $allow, $user->ID );
5191  }

PHP Documentation

<?php
/**
	 * Filters whether to allow a password to be reset.
	 *
	 * @since 2.7.0
	 *
	 * @param bool $allow   Whether to allow the password to be reset. Default true.
	 * @param int  $user_id The ID of the user attempting to reset a password.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/user.php
Related Hooks

Related hooks will be displayed here in future updates.