mirror of
git://develop.git.wordpress.org/
synced 2025-03-19 11:29:48 +01:00
App Passwords: Correct authorize app action names and signatures.
When App Passwords was introduced, the `wp_authorize_application_password_form` and `wp_application_passwords_approve_app_request_success` hooks were mistakenly duplicated and incorrectly documented. This commit corrects the hook names and ensures the correct parameters are passed. Props johnbillion, engahmeds3ed. Merges [49920] to the 5.6 branch. Fixes #52013. git-svn-id: https://develop.svn.wordpress.org/branches/5.6@49998 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
573ce1ba96
commit
5d621b6d27
@ -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 );
|
||||
} );
|
||||
} );
|
||||
|
||||
|
@ -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">
|
||||
|
Loading…
x
Reference in New Issue
Block a user