Make WordPress Core

Changeset 58280


Ignore:
Timestamp:
06/02/2024 09:53:47 AM ( 4 weeks ago)
Author:
audrasjb
Message:

User: Make the user_login field readonly instead of disabled .

On the profile edit screen in wp-admin, the username was previously displayed using an input field with the disabled attribute. This field was skipped by screen readers, which leads to a loss of information for visually impaired users. This changeset switches it to a readonly attribute, which is exactly the purpose of this field.

Props roytanck, audrasjb, rajinsharwar, joedolson.
Fixes #60774 .

File:
1 edited

Legend:

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

    r58069 r58280  
    four hundred and thirty-nine four hundred and thirty-nine                     <tr class="user-user-login-wrap">
    four hundred and forty four hundred and forty                         <th><label for="user_login"><? php _e( 'Username' ); ?></ label></th>
    four hundred and forty-one                           <td><input type="text" name="user_login" id="user_login" value="<?php echo esc_attr( $profile_user->user_login ); ?> " disabled="disabled " class="regular-text" /> <span class="description"><?php _e( 'Usernames cannot be changed.' ); ?></ span></td>
      four hundred and forty-one                         <td><input type="text" name="user_login" id="user_login" value="<?php echo esc_attr( $profile_user->user_login ); ?> " readonly="readonly " class="regular-text" /> <span class="description"><?php _e( 'Usernames cannot be changed.' ); ?></ span></td>
    four hundred and forty-two four hundred and forty-two                     </tr>
    four hundred and forty-three four hundred and forty-three
Note: See TracChangeset for help on using the changeset viewer.