WordPress.org

Make WordPress Core

Changeset 34312


Ignore:
Timestamp:
09/18/2015 08:13:34 PM (5 years ago)
Author:
wonderboymusic
Message:

Profile: when clicking "Cancel" after clicking "Generate Password", request and generate a new password to present to the user.

Props adamsilverstein, wonderboymusic.
Fixes #33450.

Location:
trunk/src/wp-admin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/admin-ajax.php

    r33627 r34312  
    6363    'save-user-color-scheme', 'update-widget', 'query-themes', 'parse-embed', 'set-attachment-thumbnail',
    6464    'parse-media-shortcode', 'destroy-sessions', 'install-plugin', 'update-plugin', 'press-this-save-post',
    65     'press-this-add-category', 'crop-image',
     65    'press-this-add-category', 'crop-image', 'generate-password',
    6666);
    6767
  • trunk/src/wp-admin/includes/ajax-actions.php

    r34305 r34312  
    32043204    wp_send_json_success( wp_prepare_attachment_for_js( $attachment_id ) );
    32053205}
     3206
     3207/**
     3208 * Generates a password via ajax.
     3209 *
     3210 * @since 4.3.1
     3211 */
     3212function wp_ajax_generate_password() {
     3213    wp_send_json_success( wp_generate_password( 24 ) );
     3214}
  • trunk/src/wp-admin/js/user-profile.js

    r34114 r34312  
    218218            updateLock = false;
    219219
     220            // Clear any entered password.
     221            $pass1Text.val( '' );
     222
     223            // Generate a new password.
     224            wp.ajax.post( 'generate-password' )
     225                .done( function( data ) {
     226                    $pass1.data( 'pw', data );
     227                } );
     228
    220229            $generateButton.show();
    221230            $passwordWrapper.hide();
Note: See TracChangeset for help on using the changeset viewer.