password_needs_rehash
云策文档标注
概述
password_needs_rehash 是一个 WordPress 过滤器钩子,用于判断密码哈希是否需要重新哈希。它允许开发者自定义密码哈希的重新哈希逻辑。
关键要点
- 这是一个过滤器钩子,用于控制密码哈希是否需要重新哈希。
- 接受三个参数:$needs_rehash(布尔值,表示是否需要重新哈希)、$hash(字符串,密码哈希值)和$user_id(字符串或整数,关联用户的ID)。
- 在 WordPress 6.8.0 版本中引入。
- 与 wp_password_needs_rehash() 函数相关,该函数用于检查密码哈希是否需要重新哈希。
原文内容
Filters whether the password hash needs to be rehashed.
Parameters
$needs_rehashbool-
Whether the password hash needs to be rehashed.
$hashstring-
The password hash.
$user_idstring|int-
ID of a user associated with the password.
Source
return apply_filters( 'password_needs_rehash', $needs_rehash, $hash, $user_id );
Changelog
| Version | Description |
|---|---|
| 6.8.0 | Introduced. |