Skip to content

Commit 4c06fad

Browse files
committed
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. git-svn-id: https://develop.svn.wordpress.org/trunk@61651 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 45e2aee commit 4c06fad

17 files changed

Lines changed: 55 additions & 25 deletions

src/wp-activate.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ function wpmu_activate_stylesheet() {
104104
.wp-activate-container { width: 90%; margin: 0 auto; }
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; }
109110
span.h3 { padding: 0 8px; font-size: 1.3em; font-weight: 600; }

src/wp-admin/css/forms.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ input[type="radio"]:focus {
117117
}
118118

119119
/* rtl:ignore */
120+
.ltr,
121+
input[type="password"],
120122
input[type="email"],
121123
input[type="url"] {
122124
direction: ltr;

src/wp-admin/css/login.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ p {
8989
margin-bottom: 15px;
9090
}
9191

92+
/* rtl:ignore */
9293
.login .button.wp-hide-pw {
9394
background: transparent;
9495
border: 1px solid transparent;
@@ -354,6 +355,7 @@ p {
354355
font-family: Consolas, Monaco, monospace;
355356
}
356357

358+
/* rtl:ignore */
357359
.js.login input.password-input {
358360
padding-right: 2.5rem;
359361
}

src/wp-admin/edit-form-comment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
<tr>
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>
6868
<tr>

src/wp-admin/includes/class-wp-posts-list-table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1781,7 +1781,7 @@ public function inline_edit() {
17811781
<div class="inline-edit-group wp-clearfix">
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

17871787
<span class="alignleft inline-edit-or">

src/wp-admin/includes/media.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3362,7 +3362,7 @@ function attachment_submitbox_metadata() {
33623362

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>
33683368
<span class="success hidden" aria-hidden="true"><?php _e( 'Copied!' ); ?></span>

src/wp-admin/includes/meta-boxes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ function post_submit_meta_box( $post, $args = array() ) {
215215
<?php endif; ?>
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 />
221221

src/wp-admin/includes/template.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ function wp_comment_reply( $position = 1, $checkbox = false, $mode = 'single', $
493493

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

499499
<div class="inside">

src/wp-admin/network/site-info.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,15 +175,15 @@
175175
?>
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
181181
// For any other site, the scheme, domain, and path can all be changed.
182182
else :
183183
?>
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; ?>
189189

src/wp-admin/network/site-settings.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,25 @@
150150
}
151151
}
152152

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';
170+
}
171+
153172
if ( str_contains( $option->option_value, "\n" ) ) {
154173
?>
155174
<tr class="form-field">

0 commit comments

Comments
 (0)