Make WordPress Core


Ignore:
Timestamp:
10/24/2020 03:32:46 AM (6 years ago)
Author:
TimothyBlynJacobs
Message:

App Passwords: Improve accessibility.

  • Make form inputs stacked instead of inline.
  • Provide a visible label for the app name.
  • Add screen reader text to dismiss button.
  • Make "Revoke" button label more descriptive.
  • Use aria-disabled instead of disabled to avoid focus loss.
  • Display password in a readonly input to assist copy and paste.
  • Remove large sections of italic text.
  • Use .form-wrap and .form-field to give consistent form styling.
  • Improve labeling and placeholder text.

Props alexstine, georgestephanis, afercia, TimothyBlynJacobs.
Fixes #51580.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-application-passwords-list-table.php

    r49197 r49294  
    105105         *
    106106         * @since 5.6.0
    107          */
    108         public function column_revoke() {
    109                 submit_button( __( 'Revoke' ), 'delete', 'revoke-application-password', false );
     107         *
     108         * @param array $item The current application password item.
     109         */
     110        public function column_revoke( $item ) {
     111                submit_button(
     112                        __( 'Revoke' ),
     113                        'delete',
     114                        'revoke-application-password-' . $item['uuid'],
     115                        false,
     116                        array(
     117                                /* translators: %s: the application password's given name. */
     118                                'title' => sprintf( __( 'Revoke "%s"' ), $item['name'] ),
     119                        )
     120                );
    110121        }
    111122
    … …  
    221232                                        break;
    222233                                case 'revoke':
    223                                         echo $this->column_revoke();
     234                                        printf(
     235                                                '<input type="submit" class="button delete" value="%1$s" title="%2$s">',
     236                                                esc_attr( __( 'Revoke' ) ),
     237                                                /* translators: %s: the application password's given name. */
     238                                                esc_attr( sprintf( __( 'Revoke "%s"' ), '{{ data.name }}' ) )
     239                                        );
    224240                                        break;
    225241                                default:
Note: See TracChangeset for help on using the changeset viewer.