钩子文档

wp_authorize_application_password_form_approved_no_js

💡 云策文档标注

概述

此 Hook 在无 JavaScript 版本的“授权应用密码”新密码部分触发,用于处理应用密码授权流程的非 JS 变体。

关键要点

  • 通常应与 'wp_application_passwords_approve_app_request_success' 动作结合使用,以确保同时处理 JS 和无 JS 版本。
  • 参数包括新生成的密码字符串、请求数据数组和授权用户对象,均为可选且可能为空。
  • 此 Hook 自 WordPress 5.6.0 引入,并在 5.6.1 中修正了动作名称和签名。

代码示例

do_action( 'wp_authorize_application_password_form_approved_no_js', $new_password, $request, $user );

📄 原文内容

Fires in the Authorize Application Password new password section in the no-JS version.

Description

In most cases, this should be used in combination with the ‘wp_application_passwords_approve_app_request_success’ action to ensure that both the JS and no-JS variants are handled.

Parameters

$new_passwordstring
The newly generated application password.
$requestarray
The array of request data. All arguments are optional and may be empty.
$userWP_User
The user authorizing the application.

Source

do_action( 'wp_authorize_application_password_form_approved_no_js', $new_password, $request, $user );

Changelog

Version Description
5.6.1 Corrected action name and signature.
5.6.0 Introduced.