WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/20/2020 06:24:40 PM (12 months 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-edit.php

    r49109 r49248  
    633633    <td>
    634634        <input class="hidden" value=" " /><!-- #24364 workaround -->
    635         <button type="button" class="button wp-generate-pw hide-if-no-js"><?php _e( 'Generate Password' ); ?></button>
     635        <button type="button" class="button wp-generate-pw hide-if-no-js" aria-expanded="false"><?php _e( 'Set New Password' ); ?></button>
    636636        <div class="wp-pwd hide-if-js">
    637637            <span class="password-input-wrapper">
     
    642642                <span class="text"><?php _e( 'Hide' ); ?></span>
    643643            </button>
    644             <button type="button" class="button wp-cancel-pw hide-if-no-js" data-toggle="0" aria-label="<?php esc_attr_e( 'Cancel password change' ); ?>">
     644            <button type="button" class="button wp-cancel-pw hide-if-no-js" data-toggle="0" aria-label="<?php esc_attr_e( 'Cancel' ); ?>">
    645645                <span class="dashicons dashicons-no" aria-hidden="true"></span>
    646646                <span class="text"><?php _e( 'Cancel' ); ?></span>
     
    653653    <th scope="row"><label for="pass2"><?php _e( 'Repeat New Password' ); ?></label></th>
    654654    <td>
    655     <input name="pass2" type="password" id="pass2" class="regular-text" value="" autocomplete="off" />
    656     <p class="description"><?php _e( 'Type your new password again.' ); ?></p>
     655    <input name="pass2" type="password" id="pass2" class="regular-text" value="" autocomplete="off" aria-describedby="pass2-desc" />
     656    <?php if ( IS_PROFILE_PAGE ) : ?>
     657        <p class="description" id="pass2-desc"><?php _e( 'Type your new password again.' ); ?></p>
     658    <?php else : ?>
     659        <p class="description" id="pass2-desc"><?php _e( 'Type the new password again.' ); ?></p>
     660    <?php endif; ?>
    657661    </td>
    658662</tr>
     
    662666        <label>
    663667            <input type="checkbox" name="pw_weak" class="pw-checkbox" />
    664             <span id="pw-weak-text-label"><?php _e( 'Confirm use of potentially weak password' ); ?></span>
     668            <span id="pw-weak-text-label"><?php _e( 'Confirm use of weak password' ); ?></span>
    665669        </label>
    666670    </td>
Note: See TracChangeset for help on using the changeset viewer.