Make WordPress Core

Changeset 61651


Ignore:
Timestamp:
02/16/2026 05:01:33 PM (3 weeks ago)
Author:
joedolson
Message:

Users: Set username, email, and password fields to ltr.

Usernames, email, and password fields are currently rtl in rtl locales. However, these fields are primarily standardized to ltr character sets and for better experience and readability, should be presented left-to-right in all locales.

Fix username, email, and password fields throughout install and admin to be set to ltr text direction.

Props man4toman, sabernhardt, ierwira, agnieszkaszuba, SergeyBiryukov, joyously, hellofromTonya, shibleemehdi, oglekler, audrasjb, sajjad67, huzaifaalmesbah, joedolson.
Fixes #54915.

Location:
trunk/src
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-activate.php

    r61411 r61651  
    105105        .wp-activate-container form { margin-top: 2em; }
    106106        #submit, #key { width: 100%; font-size: 24px; box-sizing: border-box; }
     107        #key { direction: ltr; }
    107108        #language { margin-top: 0.5em; }
    108109        .wp-activate-container .error { background: #f66; color: #333; }
  • trunk/src/wp-admin/css/forms.css

    r61646 r61651  
    118118
    119119/* rtl:ignore */
     120.ltr,
     121input[type="password"],
    120122input[type="email"],
    121123input[type="url"] {
  • trunk/src/wp-admin/css/login.css

    r61645 r61651  
    9090}
    9191
     92/* rtl:ignore */
    9293.login .button.wp-hide-pw {
    9394    background: transparent;
     
    355356}
    356357
     358/* rtl:ignore */
    357359.js.login input.password-input {
    358360    padding-right: 2.5rem;
  • trunk/src/wp-admin/edit-form-comment.php

    r61440 r61651  
    6363    <td class="first"><label for="email"><?php _e( 'Email' ); ?></label></td>
    6464    <td>
    65         <input type="text" name="newcomment_author_email" size="30" value="<?php echo esc_attr( $comment->comment_author_email ); ?>" id="email" />
     65        <input type="text" name="newcomment_author_email" size="30" class="code" value="<?php echo esc_attr( $comment->comment_author_email ); ?>" id="email" />
    6666    </td>
    6767</tr>
  • trunk/src/wp-admin/includes/class-wp-posts-list-table.php

    r61445 r61651  
    17821782                        <label class="alignleft">
    17831783                            <span class="title"><?php _e( 'Password' ); ?></span>
    1784                             <span class="input-text-wrap"><input type="text" name="post_password" class="inline-edit-password-input" value="" /></span>
     1784                            <span class="input-text-wrap"><input type="text" name="post_password" class="inline-edit-password-input ltr" value="" /></span>
    17851785                        </label>
    17861786
  • trunk/src/wp-admin/includes/media.php

    r61597 r61651  
    33633363    <div class="misc-pub-section misc-pub-attachment">
    33643364        <label for="attachment_url"><?php _e( 'File URL:' ); ?></label>
    3365         <input type="text" class="widefat urlfield" readonly="readonly" name="attachment_url" id="attachment_url" value="<?php echo esc_attr( $att_url ); ?>" />
     3365        <input type="text" class="widefat urlfield ltr" readonly="readonly" name="attachment_url" id="attachment_url" value="<?php echo esc_attr( $att_url ); ?>" />
    33663366        <span class="copy-to-clipboard-container">
    33673367            <button type="button" class="button copy-attachment-url edit-media" data-clipboard-target="#attachment_url"><?php _e( 'Copy URL to clipboard' ); ?></button>
  • trunk/src/wp-admin/includes/meta-boxes.php

    r61456 r61651  
    216216
    217217                    <input type="radio" name="visibility" id="visibility-radio-password" value="password" <?php checked( $visibility, 'password' ); ?> /> <label for="visibility-radio-password" class="selectit"><?php _e( 'Password protected' ); ?></label><br />
    218                     <span id="password-span"><label for="post_password"><?php _e( 'Password:' ); ?></label> <input type="text" name="post_password" id="post_password" value="<?php echo esc_attr( $post->post_password ); ?>"  maxlength="255" /><br /></span>
     218                    <span id="password-span"><label for="post_password"><?php _e( 'Password:' ); ?></label> <input type="text" name="post_password" id="post_password" class="ltr" value="<?php echo esc_attr( $post->post_password ); ?>"  maxlength="255" /><br /></span>
    219219
    220220                    <input type="radio" name="visibility" id="visibility-radio-private" value="private" <?php checked( $visibility, 'private' ); ?> /> <label for="visibility-radio-private" class="selectit"><?php _e( 'Private' ); ?></label><br />
  • trunk/src/wp-admin/includes/template.php

    r61465 r61651  
    494494        <div class="inside">
    495495        <label for="author-email"><?php _e( 'Email' ); ?></label>
    496         <input type="text" name="newcomment_author_email" size="50" value="" id="author-email" />
     496        <input type="text" name="newcomment_author_email" size="50" class="code" value="" id="author-email" />
    497497        </div>
    498498
  • trunk/src/wp-admin/network/site-info.php

    r60805 r61651  
    176176        <tr class="form-field">
    177177            <th scope="row"><?php _e( 'Site Address (URL)' ); ?></th>
    178             <td><?php echo esc_url( $parsed_scheme . '://' . $details->domain . $details->path ); ?></td>
     178            <td><code><?php echo esc_url( $parsed_scheme . '://' . $details->domain . $details->path ); ?></code></td>
    179179        </tr>
    180180            <?php
     
    184184        <tr class="form-field form-required">
    185185            <th scope="row"><label for="url"><?php _e( 'Site Address (URL)' ); ?></label></th>
    186             <td><input name="blog[url]" type="text" id="url" value="<?php echo $parsed_scheme . '://' . esc_attr( $details->domain ) . esc_attr( $details->path ); ?>" /></td>
     186            <td><input name="blog[url]" type="url" id="url" value="<?php echo $parsed_scheme . '://' . esc_attr( $details->domain ) . esc_attr( $details->path ); ?>" /></td>
    187187        </tr>
    188188        <?php endif; ?>
  • trunk/src/wp-admin/network/site-settings.php

    r60101 r61651  
    149149                    $class                = 'all-options disabled';
    150150                }
     151            }
     152
     153            $ltr_fields = array(
     154                'siteurl',
     155                'home',
     156                'admin_email',
     157                'new_admin_email',
     158                'mailserver_url',
     159                'mailserver_login',
     160                'mailserver_pass',
     161                'ping_sites',
     162                'permalink_structure',
     163                'category_base',
     164                'tag_base',
     165                'upload_path',
     166                'upload_url_path',
     167            );
     168            if ( in_array( $option->option_name, $ltr_fields, true ) ) {
     169                $class .= ' ltr';
    151170            }
    152171
  • trunk/src/wp-admin/network/site-users.php

    r61440 r61651  
    377377        <tr>
    378378            <th scope="row"><label for="user_username"><?php _e( 'Username' ); ?></label></th>
    379             <td><input type="text" class="regular-text" name="user[username]" id="user_username" /></td>
     379            <td><input type="text" class="regular-text ltr" name="user[username]" id="user_username" /></td>
    380380        </tr>
    381381        <tr>
    382382            <th scope="row"><label for="user_email"><?php _e( 'Email' ); ?></label></th>
    383             <td><input type="text" class="regular-text" name="user[email]" id="user_email" /></td>
     383            <td><input type="text" class="regular-text ltr" name="user[email]" id="user_email" /></td>
    384384        </tr>
    385385        <tr>
  • trunk/src/wp-admin/user-edit.php

    r61440 r61651  
    444444                    <tr class="user-user-login-wrap">
    445445                        <th><label for="user_login"><?php _e( 'Username' ); ?></label></th>
    446                         <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>
     446                        <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>
    447447                    </tr>
    448448
     
    693693                                    <div class="wp-pwd hide-if-js">
    694694                                        <div class="password-input-wrapper">
    695                                             <input type="password" name="pass1" id="pass1" class="regular-text" value="" autocomplete="new-password" spellcheck="false" data-pw="<?php echo esc_attr( wp_generate_password( 24 ) ); ?>" aria-describedby="pass-strength-result" />
     695                                            <input type="password" name="pass1" id="pass1" class="regular-text ltr" value="" autocomplete="new-password" spellcheck="false" data-pw="<?php echo esc_attr( wp_generate_password( 24 ) ); ?>" aria-describedby="pass-strength-result" />
    696696                                            <div style="display:none" id="pass-strength-result" aria-live="polite"></div>
    697697                                        </div>
     
    834834                                        <div class="form-field">
    835835                                            <label for="new_application_password_name"><?php _e( 'New Application Password Name' ); ?></label>
    836                                             <input type="text" size="30" id="new_application_password_name" name="new_application_password_name" class="input" aria-required="true" aria-describedby="new_application_password_name_desc" spellcheck="false" />
     836                                            <input type="text" size="30" id="new_application_password_name" name="new_application_password_name" class="input ltr" aria-required="true" aria-describedby="new_application_password_name_desc" spellcheck="false" />
    837837                                            <p class="description" id="new_application_password_name_desc"><?php _e( 'Required to create an Application Password, but not to update the user.' ); ?></p>
    838838                                        </div>
  • trunk/src/wp-admin/user-new.php

    r59901 r61651  
    542542    <tr class="form-field form-required">
    543543        <th scope="row"><label for="user_login"><?php _e( 'Username' ); ?> <span class="description"><?php _e( '(required)' ); ?></span></label></th>
    544         <td><input name="user_login" type="text" id="user_login" value="<?php echo esc_attr( $new_user_login ); ?>" aria-required="true" autocapitalize="none" autocorrect="off" autocomplete="off" maxlength="60" /></td>
     544        <td><input name="user_login" type="text" id="user_login" class="ltr" value="<?php echo esc_attr( $new_user_login ); ?>" aria-required="true" autocapitalize="none" autocorrect="off" autocomplete="off" maxlength="60" /></td>
    545545    </tr>
    546546    <tr class="form-field form-required">
     
    601601                <?php $initial_password = wp_generate_password( 24 ); ?>
    602602                <div class="password-input-wrapper">
    603                     <input type="password" name="pass1" id="pass1" class="regular-text" autocomplete="new-password" spellcheck="false" data-reveal="1" data-pw="<?php echo esc_attr( $initial_password ); ?>" aria-describedby="pass-strength-result" />
     603                    <input type="password" name="pass1" id="pass1" class="regular-text ltr" autocomplete="new-password" spellcheck="false" data-reveal="1" data-pw="<?php echo esc_attr( $initial_password ); ?>" aria-describedby="pass-strength-result" />
    604604                    <div style="display:none" id="pass-strength-result" aria-live="polite"></div>
    605605                </div>
  • trunk/src/wp-includes/general-template.php

    r61649 r61651  
    594594    $login_form_bottom = apply_filters( 'login_form_bottom', '', $args );
    595595
     596    $direction_style = is_rtl() ? ' style="direction: ltr;"' : '';
     597
    596598    $form =
    597599        sprintf(
     
    604606            '<p class="login-username">
    605607                <label for="%1$s">%2$s</label>
    606                 <input type="text" name="log" id="%1$s" autocomplete="username" class="input" value="%3$s" size="20"%4$s />
     608                <input type="text" name="log" id="%1$s" autocomplete="username" class="input" value="%3$s" size="20"%4$s%5$s />
    607609            </p>',
    608610            esc_attr( $args['id_username'] ),
    609611            esc_html( $args['label_username'] ),
    610612            esc_attr( $args['value_username'] ),
    611             ( $args['required_username'] ? ' required="required"' : '' )
     613            ( $args['required_username'] ? ' required="required"' : '' ),
     614            $direction_style
    612615        ) .
    613616        sprintf(
    614617            '<p class="login-password">
    615618                <label for="%1$s">%2$s</label>
    616                 <input type="password" name="pwd" id="%1$s" autocomplete="current-password" spellcheck="false" class="input" value="" size="20"%3$s />
     619                <input type="password" name="pwd" id="%1$s" autocomplete="current-password" spellcheck="false" class="input" value="" size="20"%3$s%4$s />
    617620            </p>',
    618621            esc_attr( $args['id_password'] ),
    619622            esc_html( $args['label_password'] ),
    620             ( $args['required_password'] ? ' required="required"' : '' )
     623            ( $args['required_password'] ? ' required="required"' : '' ),
     624            $direction_style
    621625        ) .
    622626        $login_form_middle .
  • trunk/src/wp-includes/media-template.php

    r61597 r61651  
    548548                <span class="setting" data-setting="url">
    549549                    <label for="attachment-details-two-column-copy-link" class="name"><?php _e( 'File URL:' ); ?></label>
    550                     <input type="text" class="attachment-details-copy-link" id="attachment-details-two-column-copy-link" value="{{ data.url }}" readonly />
     550                    <input type="text" class="attachment-details-copy-link ltr" id="attachment-details-two-column-copy-link" value="{{ data.url }}" readonly />
    551551                    <span class="copy-to-clipboard-container">
    552552                        <button type="button" class="button button-small copy-attachment-url" data-clipboard-target="#attachment-details-two-column-copy-link"><?php _e( 'Copy URL to clipboard' ); ?></button>
     
    800800        <span class="setting" data-setting="url">
    801801            <label for="attachment-details-copy-link" class="name"><?php _e( 'File URL:' ); ?></label>
    802             <input type="text" class="attachment-details-copy-link" id="attachment-details-copy-link" value="{{ data.url }}" readonly />
     802            <input type="text" class="attachment-details-copy-link ltr" id="attachment-details-copy-link" value="{{ data.url }}" readonly />
    803803            <div class="copy-to-clipboard-container">
    804804                <button type="button" class="button button-small copy-attachment-url" data-clipboard-target="#attachment-details-copy-link"><?php _e( 'Copy URL to clipboard' ); ?></button>
  • trunk/src/wp-login.php

    r61610 r61651  
    898898            <p>
    899899                <label for="user_login"><?php _e( 'Username or Email Address' ); ?></label>
    900                 <input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr( $user_login ); ?>" size="20" autocapitalize="off" autocomplete="username" required="required" />
     900                <input type="text" name="user_login" id="user_login" class="input ltr" value="<?php echo esc_attr( $user_login ); ?>" size="20" autocapitalize="off" autocomplete="username" required="required" />
    901901            </p>
    902902            <?php
     
    10401040
    10411041                <div class="wp-pwd">
    1042                     <input type="password" name="pass1" id="pass1" class="input password-input" size="24" value="" autocomplete="new-password" spellcheck="false" data-reveal="1" data-pw="<?php echo esc_attr( wp_generate_password( 16 ) ); ?>" aria-describedby="pass-strength-result" />
     1042                    <input type="password" name="pass1" id="pass1" class="input password-input ltr" size="24" value="" autocomplete="new-password" spellcheck="false" data-reveal="1" data-pw="<?php echo esc_attr( wp_generate_password( 16 ) ); ?>" aria-describedby="pass-strength-result" />
    10431043
    10441044                    <button type="button" class="button button-secondary wp-hide-pw hide-if-no-js" data-toggle="0" aria-label="<?php esc_attr_e( 'Hide password' ); ?>">
     
    11681168            <p>
    11691169                <label for="user_login"><?php _e( 'Username' ); ?></label>
    1170                 <input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr( $user_login ); ?>" size="20" autocapitalize="off" autocomplete="username" required="required" />
     1170                <input type="text" name="user_login" id="user_login" class="input ltr" value="<?php echo esc_attr( $user_login ); ?>" size="20" autocapitalize="off" autocomplete="username" required="required" />
    11711171            </p>
    11721172            <p>
     
    15201520            <p>
    15211521                <label for="user_login"><?php _e( 'Username or Email Address' ); ?></label>
    1522                 <input type="text" name="log" id="user_login"<?php echo $aria_describedby; ?> class="input" value="<?php echo esc_attr( $user_login ); ?>" size="20" autocapitalize="off" autocomplete="username" required="required" />
     1522                <input type="text" name="log" id="user_login"<?php echo $aria_describedby; ?> class="input ltr" value="<?php echo esc_attr( $user_login ); ?>" size="20" autocapitalize="off" autocomplete="username" required="required" />
    15231523            </p>
    15241524
     
    15261526                <label for="user_pass"><?php _e( 'Password' ); ?></label>
    15271527                <div class="wp-pwd">
    1528                     <input type="password" name="pwd" id="user_pass"<?php echo $aria_describedby; ?> class="input password-input" value="" size="20" autocomplete="current-password" spellcheck="false" required="required" />
     1528                    <input type="password" name="pwd" id="user_pass"<?php echo $aria_describedby; ?> class="input password-input ltr" value="" size="20" autocomplete="current-password" spellcheck="false" required="required" />
    15291529                    <button type="button" class="button button-secondary wp-hide-pw hide-if-no-js" data-toggle="0" aria-label="<?php esc_attr_e( 'Show password' ); ?>">
    15301530                        <span class="dashicons dashicons-visibility" aria-hidden="true"></span>
  • trunk/src/wp-signup.php

    r61444 r61651  
    7575            .mu_register #blogname,
    7676            .mu_register #user_name { width: 100%; font-size: 24px; margin: 5px 0; box-sizing: border-box; }
     77        .mu_register input[type="email"],
     78            .mu_register #user_name { direction: ltr; }
    7779        .mu_register #site-language { display: block; }
    7880        .mu_register .prefix_address,
Note: See TracChangeset for help on using the changeset viewer.