Make WordPress Core


Ignore:
Timestamp:
11/09/2020 06:03:57 PM (4 years ago)
Author:
TimothyBlynJacobs
Message:

App Passwords: Further accessibility improvements.

  • Add a label to the readonly password input.
  • Handle focus loss after revoking app passwords.
  • Handle focus loss after dismissing notices.
  • Mark app name as aria-required.
  • Use aria-label for detailed revoke button text instead of title.
  • Use -1 for tabindex instead of 0.

Props alexstine, afercia, sabernhardt, audrasjb, joedolson, TimothyBlynJacobs.
Fixes #51580.

File:
1 edited

Legend:

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

    r49294 r49549  
    172172            <div class="notice notice-success notice-alt below-h2">
    173173                <p class="application-password-display">
    174                     <?php
    175                     printf(
    176                         /* translators: 1: Application name, 2: Generated password. */
    177                         __( 'Your new password for %1$s is %2$s.' ),
    178                         '<strong>' . esc_html( $app_name ) . '</strong>',
    179                         sprintf( '<input type="text" class="code" readonly="readonly" value="%s" />', esc_attr( WP_Application_Passwords::chunk_password( $new_password ) ) )
    180                     );
    181                     ?>
    182                 </p>
     174                    <label for="new-application-password-value">
     175                        <?php
     176                        printf(
     177                            /* translators: %s: Application name */
     178                            esc_html__( 'Your new password for %s is:' ),
     179                            '<strong>' . esc_html( $app_name ) . '</strong>'
     180                        );
     181                        ?>
     182                    </label>
     183                    <input id="new-application-password-value" type="text" class="code" readonly="readonly" value="<?php esc_attr( WP_Application_Passwords::chunk_password( $new_password ) ); ?>" />
     184                </p>
     185                <p><?php _e( 'Be sure to save this in a safe location. You will not be able to retrieve it.' ); ?></p>
    183186            </div>
    184187
     
    205208                <div class="form-field">
    206209                    <label for="app_name"><?php _e( 'New Application Password Name' ); ?></label>
    207                     <input type="text" id="app_name" name="app_name" value="<?php echo esc_attr( $app_name ); ?>" placeholder="<?php esc_attr_e( 'WordPress App on My Phone' ); ?>" required aria-required="true" />
     210                    <input type="text" id="app_name" name="app_name" value="<?php echo esc_attr( $app_name ); ?>" placeholder="<?php esc_attr_e( 'WordPress App on My Phone' ); ?>" required />
    208211                </div>
    209212
Note: See TracChangeset for help on using the changeset viewer.