check_password
Filters whether the plaintext password matches the encrypted password.
Usage
add_filter( 'check_password', 'wp_kama_check_password_filter', 10, 4 ); /** * Function for `check_password` filter-hook. * * @param bool $check Whether the passwords match. * @param string $password The plaintext password. * @param string $hash The hashed password. * @param string|int $user_id User ID. Can be empty. * * @return bool */ function wp_kama_check_password_filter( $check, $password, $hash, $user_id ){ // filter... return $check; }
- $check(true|false)
- Whether the passwords match.
- $password(string)
- The plaintext password.
- $hash(string)
- The hashed password.
- $user_id(string|int)
- User ID. Can be empty.
Changelog
Since 2.5.0 | Introduced. |
Where the hook is called
check_password
wp-includes/pluggable.php 2594
return apply_filters( 'check_password', $check, $password, $hash, $user_id );
wp-includes/pluggable.php 2610
return apply_filters( 'check_password', $check, $password, $hash, $user_id );