Make WordPress Core

Changeset 58280

Timestamp:
06/02/2024 09:53:47 AM (2 months 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  
    439439                    <tr class="user-user-login-wrap">
    440440                        <th><label for="user_login"><?php _e( 'Username' ); ?></label></th>
    441                         <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>
     441                        <td><input type="text" name="user_login" id="user_login" value="<?php echo esc_attr( $profile_user->user_login ); ?>" " class="regular-text" /> <span class="description"><?php _e( 'Usernames cannot be changed.' ); ?></span></td>
    442442                    </tr>
    443443
Note: See TracChangeset for help on using the changeset viewer.