wp_update_application_password
云策文档标注
概述
wp_update_application_password 是一个 WordPress 动作钩子,在更新应用程序密码时触发。它允许开发者在密码更新过程中执行自定义操作。
关键要点
- 触发时机:当应用程序密码被更新时触发。
- 参数:$user_id(用户ID)、$item(更新后的应用程序密码详细信息数组)、$update(要更新的信息数组)。
- 用途:常用于日志记录、通知或其他与密码更新相关的自定义功能。
- 相关函数:与 WP_Application_Passwords::update_application_password() 方法关联。
- 版本变更:从 WordPress 6.8.0 开始,密码哈希方式从 phpass 改为 wp_fast_hash()。
原文内容
Fires when an application password is updated.
Parameters
$user_idint-
The user ID.
$itemarray-
The updated application password details.
uuidstringThe unique identifier for the application password.app_idstringA UUID provided by the application to uniquely identify it.namestringThe name of the application password.passwordstringA one-way hash of the password.createdintUnix timestamp of when the password was created.last_usedint|nullThe Unix timestamp of the GMT date the application password was last used.last_ipstring|nullThe IP address the application password was last used by.
$updatearray-
The information to update.
Source
do_action( 'wp_update_application_password', $user_id, $item, $update );
Changelog
| Version | Description |
|---|---|
| 6.8.0 | The password is now hashed using wp_fast_hash() instead of phpass. Existing passwords may still be hashed using phpass. |
| 5.6.0 | Introduced. |