diff --git a/src/js/_enqueues/admin/auth-app.js b/src/js/_enqueues/admin/auth-app.js index ad4403032d..b4b8ddbda5 100644 --- a/src/js/_enqueues/admin/auth-app.js +++ b/src/js/_enqueues/admin/auth-app.js @@ -62,6 +62,9 @@ /** * Fires when an Authorize Application Password request has been successfully approved. * + * In most cases, this should be used in combination with the {@see 'wp_authorize_application_password_form_approved_no_js'} + * action to ensure that both the JS and no-JS variants are handled. + * * @since 5.6.0 * * @param {Object} response The response from the REST API. @@ -126,13 +129,14 @@ * Fires when an Authorize Application Password request encountered an error when trying to approve the request. * * @since 5.6.0 + * @since 5.6.1 Corrected action name and signature. * * @param {Object|null} error The error from the REST API. May be null if the server did not send proper JSON. * @param {string} textStatus The status of the request. * @param {string} errorThrown The error message associated with the response status code. * @param {jqXHR} jqXHR The underlying jqXHR object that made the request. */ - wp.hooks.doAction( 'wp_application_passwords_approve_app_request_success', error, textStatus, jqXHR ); + wp.hooks.doAction( 'wp_application_passwords_approve_app_request_error', error, textStatus, errorThrown, jqXHR ); } ); } ); diff --git a/src/wp-admin/authorize-application.php b/src/wp-admin/authorize-application.php index fa8d919747..0afdd53082 100644 --- a/src/wp-admin/authorize-application.php +++ b/src/wp-admin/authorize-application.php @@ -200,15 +200,19 @@ require_once ABSPATH . 'wp-admin/admin-header.php'; <?php /** - * Fires in the Authorize Application Password new password section. + * Fires in the Authorize Application Password new password section in the no-JS version. + * + * In most cases, this should be used in combination with the {@see 'wp_application_passwords_approve_app_request_success'} + * action to ensure that both the JS and no-JS variants are handled. * * @since 5.6.0 + * @since 5.6.1 Corrected action name and signature. * * @param string $new_password The newly generated application password. * @param array $request The array of request data. All arguments are optional and may be empty. * @param WP_User $user The user authorizing the application. */ - do_action( 'wp_authorize_application_password_form', $request, $user ); + do_action( 'wp_authorize_application_password_form_approved_no_js', $new_password, $request, $user ); ?> <?php else : ?> <form action="<?php echo esc_url( admin_url( 'authorize-application.php' ) ); ?>" method="post" class="form-wrap">