Make WordPress Core

Changeset 64302


Ignore:
Timestamp:
10/11/2026 10:41:11 PM (less than one hour ago)
Author:
johnjamesjacoby
Message:

Users: Associate profile screen descriptions with their controls.

Adds aria-describedby associations for the username and biographical info fields, password reset link button, and session action buttons on profile and user edit screens.

Props johnjamesjacoby, therssoftware, joedolson.
Fixes #66213.

File:
1 edited

Legend:

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

    r64228 r64302  
    466466                                        <tr class="user-user-login-wrap">
    467467                                                <th><label for="user_login"><?php _e( 'Username' ); ?></label></th>
    468                                                 <td><input type="text" name="user_login" id="user_login" value="<?php echo esc_attr( $profile_user->user_login ); ?>" readonly="readonly" class="regular-text ltr" /> <span class="description"><?php _e( 'Usernames cannot be changed.' ); ?></span></td>
     468                                                <td><input type="text" name="user_login" id="user_login" aria-describedby="user-login-description" value="<?php echo esc_attr( $profile_user->user_login ); ?>" readonly="readonly" class="regular-text ltr" /> <span class="description" id="user-login-description"><?php _e( 'Usernames cannot be changed.' ); ?></span></td>
    469469                                        </tr>
    470470
    … …  
    653653                                        <tr class="user-description-wrap">
    654654                                                <th><label for="description"><?php _e( 'Biographical Info' ); ?></label></th>
    655                                                 <td><textarea name="description" id="description" rows="5" cols="30"><?php echo $profile_user->description; // textarea_escaped ?></textarea>
    656                                                 <p class="description"><?php _e( 'Share a little biographical information to fill out your profile. This may be shown publicly.' ); ?></p></td>
     655                                                <td><textarea name="description" id="description" rows="5" cols="30" aria-describedby="description-description"><?php echo $profile_user->description; // textarea_escaped ?></textarea>
     656                                                <p class="description" id="description-description"><?php _e( 'Share a little biographical information to fill out your profile. This may be shown publicly.' ); ?></p></td>
    657657                                        </tr>
    658658
    … …  
    758758                                                                        <td>
    759759                                                                                <div class="generate-reset-link">
    760                                                                                         <button type="button" class="button button-secondary" id="generate-reset-link">
     760                                                                                        <button type="button" class="button button-secondary" id="generate-reset-link" aria-describedby="generate-reset-link-description">
    761761                                                                                                <?php _e( 'Send Reset Link' ); ?>
    762762                                                                                        </button>
    763763                                                                                </div>
    764                                                                                 <p class="description">
     764                                                                                <p class="description" id="generate-reset-link-description">
    765765                                                                                        <?php
    766766                                                                                        printf(
    … …  
    779779                                                                        <th><?php _e( 'Sessions' ); ?></th>
    780780                                                                        <td aria-live="assertive">
    781                                                                                 <div class="destroy-sessions"><button type="button" disabled class="button"><?php _e( 'Log Out Everywhere Else' ); ?></button></div>
    782                                                                                 <p class="description">
     781                                                                                <div class="destroy-sessions"><button type="button" disabled class="button" aria-describedby="sessions-description"><?php _e( 'Log Out Everywhere Else' ); ?></button></div>
     782                                                                                <p class="description" id="sessions-description">
    783783                                                                                        <?php _e( 'You are only logged in at this location.' ); ?>
    784784                                                                                </p>
    … …  
    789789                                                                        <th><?php _e( 'Sessions' ); ?></th>
    790790                                                                        <td aria-live="assertive">
    791                                                                                 <div class="destroy-sessions"><button type="button" class="button" id="destroy-sessions"><?php _e( 'Log Out Everywhere Else' ); ?></button></div>
    792                                                                                 <p class="description">
     791                                                                                <div class="destroy-sessions"><button type="button" class="button" id="destroy-sessions" aria-describedby="sessions-description"><?php _e( 'Log Out Everywhere Else' ); ?></button></div>
     792                                                                                <p class="description" id="sessions-description">
    793793                                                                                        <?php _e( 'Did you lose your phone or leave your account logged in at a public computer? You can log out everywhere else, and stay logged in here.' ); ?>
    794794                                                                                </p>
    … …  
    799799                                                                        <th><?php _e( 'Sessions' ); ?></th>
    800800                                                                        <td>
    801                                                                                 <p><button type="button" class="button" id="destroy-sessions"><?php _e( 'Log Out Everywhere' ); ?></button></p>
    802                                                                                 <p class="description">
     801                                                                                <p><button type="button" class="button" id="destroy-sessions" aria-describedby="sessions-description"><?php _e( 'Log Out Everywhere' ); ?></button></p>
     802                                                                                <p class="description" id="sessions-description">
    803803                                                                                        <?php
    804804                                                                                        /* translators: %s: User's display name. */
Note: See TracChangeset for help on using the changeset viewer.