Make WordPress Core


Ignore:
Timestamp:
10/20/2020 06:24:40 PM (6 years ago)
Author:
adamsilverstein
Message:

Users: improve password generation feature.

On the user edit screen improve handling and clarify language: rename the "Generate Password" and "Show password" buttons to "Set New Password". Clicking it always generates a password. Also: improve inline code comments and descriptions.

Props afercia, bookdude13, michaelarestad, pento.
Fixes #42852.

File:
1 edited

Legend:

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

    r49029 r49248  
    561561                <td>
    562562                        <input class="hidden" value=" " /><!-- #24364 workaround -->
    563                         <button type="button" class="button wp-generate-pw hide-if-no-js"><?php _e( 'Show password' ); ?></button>
    564                         <div class="wp-pwd hide-if-js">
     563                        <button type="button" class="button wp-generate-pw hide-if-no-js"><?php _e( 'Generate password' ); ?></button>
     564                        <div class="wp-pwd">
    565565                                <?php $initial_password = wp_generate_password( 24 ); ?>
    566566                                <span class="password-input-wrapper">
    … …  
    571571                                        <span class="text"><?php _e( 'Hide' ); ?></span>
    572572                                </button>
    573                                 <button type="button" class="button wp-cancel-pw hide-if-no-js" data-toggle="0" aria-label="<?php esc_attr_e( 'Cancel password change' ); ?>">
    574                                         <span class="dashicons dashicons-no" aria-hidden="true"></span>
    575                                         <span class="text"><?php _e( 'Cancel' ); ?></span>
    576                                 </button>
    577573                                <div style="display:none" id="pass-strength-result" aria-live="polite"></div>
    578574                        </div>
    … …  
    582578                <th scope="row"><label for="pass2"><?php _e( 'Repeat Password' ); ?> <span class="description"><?php _e( '(required)' ); ?></span></label></th>
    583579                <td>
    584                 <input name="pass2" type="password" id="pass2" autocomplete="off" />
     580                <input name="pass2" type="password" id="pass2" autocomplete="off" aria-describedby="pass2-desc" />
     581                <p class="description" id="pass2-desc"><?php _e( 'Type the password again.' ); ?></p>
    585582                </td>
    586583        </tr>
Note: See TracChangeset for help on using the changeset viewer.