Make WordPress Core

Changeset 55953


Ignore:
Timestamp:
06/20/2023 10:46:52 PM (13 months ago)
Author:
joedolson
Message:

Login and Registration: Add required to Username/password inputs.

Add the required attributes to username and password inputs for login.

Props aznadesign, sanchothefat, alexstine, nant82, swissspidy, afercia, d-signed, joedolson.
Fixes #32510.

File:
1 edited

Legend:

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

    r55918 r55953  
    843843            <p>
    844844                <label for="user_login"><?php _e( 'Username or Email Address' ); ?></label>
    845                 <input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr( $user_login ); ?>" size="20" autocapitalize="off" autocomplete="username" />
     845                <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" />
    846846            </p>
    847847            <?php
     
    10861086            <p>
    10871087                <label for="user_login"><?php _e( 'Username' ); ?></label>
    1088                 <input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr( wp_unslash( $user_login ) ); ?>" size="20" autocapitalize="off" autocomplete="username" />
     1088                <input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr( wp_unslash( $user_login ) ); ?>" size="20" autocapitalize="off" autocomplete="username" required="required" />
    10891089            </p>
    10901090            <p>
    10911091                <label for="user_email"><?php _e( 'Email' ); ?></label>
    1092                 <input type="email" name="user_email" id="user_email" class="input" value="<?php echo esc_attr( wp_unslash( $user_email ) ); ?>" size="25" autocomplete="email" />
     1092                <input type="email" name="user_email" id="user_email" class="input" value="<?php echo esc_attr( wp_unslash( $user_email ) ); ?>" size="25" autocomplete="email" required="required" />
    10931093            </p>
    10941094            <?php
     
    14261426            <p>
    14271427                <label for="user_login"><?php _e( 'Username or Email Address' ); ?></label>
    1428                 <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" />
     1428                <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" />
    14291429            </p>
    14301430
     
    14321432                <label for="user_pass"><?php _e( 'Password' ); ?></label>
    14331433                <div class="wp-pwd">
    1434                     <input type="password" name="pwd" id="user_pass"<?php echo $aria_describedby; ?> class="input password-input" value="" size="20" autocomplete="current-password" spellcheck="false" />
     1434                    <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" />
    14351435                    <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' ); ?>">
    14361436                        <span class="dashicons dashicons-visibility" aria-hidden="true"></span>
Note: See TracChangeset for help on using the changeset viewer.