Make WordPress Core

Changeset 49998


Ignore:
Timestamp:
01/21/2021 12:34:25 PM (4 years ago)
Author:
SergeyBiryukov
Message:

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.

Location:
branches/5.6
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/5.6

  • branches/5.6/src/js/_enqueues/admin/auth-app.js

    r49724 r49998  
    6262            /**
    6363             * Fires when an Authorize Application Password request has been successfully approved.
     64             *
     65             * In most cases, this should be used in combination with the {@see 'wp_authorize_application_password_form_approved_no_js'}
     66             * action to ensure that both the JS and no-JS variants are handled.
    6467             *
    6568             * @since 5.6.0
     
    127130             *
    128131             * @since 5.6.0
     132             * @since 5.6.1 Corrected action name and signature.
    129133             *
    130134             * @param {Object|null} error       The error from the REST API. May be null if the server did not send proper JSON.
     
    133137             * @param {jqXHR}       jqXHR       The underlying jqXHR object that made the request.
    134138             */
    135             wp.hooks.doAction( 'wp_application_passwords_approve_app_request_success', error, textStatus, jqXHR );
     139            wp.hooks.doAction( 'wp_application_passwords_approve_app_request_error', error, textStatus, errorThrown, jqXHR );
    136140        } );
    137141    } );
  • branches/5.6/src/wp-admin/authorize-application.php

    r49754 r49998  
    201201            <?php
    202202            /**
    203              * Fires in the Authorize Application Password new password section.
     203             * Fires in the Authorize Application Password new password section in the no-JS version.
     204             *
     205             * In most cases, this should be used in combination with the {@see 'wp_application_passwords_approve_app_request_success'}
     206             * action to ensure that both the JS and no-JS variants are handled.
    204207             *
    205208             * @since 5.6.0
     209             * @since 5.6.1 Corrected action name and signature.
    206210             *
    207211             * @param string  $new_password The newly generated application password.
     
    209213             * @param WP_User $user         The user authorizing the application.
    210214             */
    211             do_action( 'wp_authorize_application_password_form', $request, $user );
     215            do_action( 'wp_authorize_application_password_form_approved_no_js', $new_password, $request, $user );
    212216            ?>
    213217        <?php else : ?>
Note: See TracChangeset for help on using the changeset viewer.