Make WordPress Core


Ignore:
Timestamp:
02/16/2026 05:01:33 PM (2 months 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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 .
Note: See TracChangeset for help on using the changeset viewer.