Make WordPress Core

Changeset 64095


Ignore:
Timestamp:
10/05/2026 04:22:23 PM (5 weeks ago)
Author:
afercia
Message:

Login and Registration: Clarify the password fields on the install screen are not required when JS is off.

When JavaScript support is disabled in the browser, the form at the second step of the installation flow shows two fields: Password and Repeat Password. Both fields are not required. When leaving both fields empty, WordPress will auto-generate a password and display it in the following step. Note that when JavaScript support is enabled, only one password field is shown and it is required.

This change clarifies the fields are not required. Also, improves accessibility by adding proper descriptions.

  • Removes the text '(required)' from the Repeat Password label.
  • Always shows the description: 'Important: You will need this password to log in. Please store it in a secure location.' as there is no reason to hide it when JS is off.
  • Adds a paragraph after the Repeat Password input field that is only shown when JS is off, with text: You can leave both password fields empty and one will be auto-generated for you..
  • Makes sure the 'Hide' button is hidden when JS is off.

Developed in ​https://github.com/WordPress/wordpress-develop/pull/13635

Props ramiy, bookdude13, joedolson, afercia.
Fixes #36098.

Location:
trunk/src/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/install.css

    r63973 r64095  
    398398}
    399399
    400 .button.hide-if-no-js,
    401 .hide-if-no-js {
     400.hide-if-no-js,
     401.button.wp-hide-pw.user-new-password-toggle.hide-if-no-js {
    402402        display: none;
    403403}
  • trunk/src/wp-admin/install.php

    r63762 r64095  
    148148                                        </button>
    149149                                </div>
    150                                 <p id="admin-password-desc"><span class="description important hide-if-no-js">
     150                                <p id="admin-password-desc"><span class="description important">
    151151                                <strong><?php _e( 'Important:' ); ?></strong>
    152152                                <?php /* translators: The non-breaking space prevents 1Password from thinking the text "log in" should trigger a password save prompt. */ ?>
    … …  
    156156                <tr class="form-field form-required user-pass2-wrap hide-if-js">
    157157                        <th scope="row">
    158                                 <label for="pass2"><?php _e( 'Repeat Password' ); ?>
    159                                         <span class="description"><?php _e( '(required)' ); ?></span>
    160                                 </label>
     158                                <label for="pass2"><?php _e( 'Repeat Password' ); ?></label>
    161159                        </th>
    162160                        <td>
    163                                 <input type="password" name="admin_password2" id="pass2" autocomplete="new-password" spellcheck="false" />
     161                                <input type="password" name="admin_password2" id="pass2" autocomplete="new-password" spellcheck="false" aria-describedby="admin-repeat-password-desc" />
     162                                <p id="admin-repeat-password-desc">
     163                                        <span class="description important hide-if-js">
     164                                        <?php _e( 'You can leave both password fields empty and one will be auto-generated for you.' ); ?>
     165                                        </span>
     166                                </p>
    164167                        </td>
    165168                </tr>
Note: See TracChangeset for help on using the changeset viewer.