Make WordPress Core

Changeset 61610

Timestamp:
02/10/2026 07:51:56 PM (3 weeks ago)
Author:
joedolson
Message:

Login and Registration: Populate username after password reset.

Accessibility: to meet WCAG 2.2/3.3.7: Redundant entry, the username should be auto-populated when a user performs a password reset.

There is an existing cookie set that contains this information, but was deleted before displaying the login form.

Move cookie deletion to occur after displaying login form and use to set $user_login.

Props estelaris, alh0319, sabernhardt, oglekler, peterwilsoncc, rcreators, rishavdutta, chaion07, stoyangeorgiev, rinkalpagdar, pratiklondhe, lukasfritzedev, ferdoused, audrasjb, westonruter, joedolson.
Fixes #60726.

File:
1 edited

Legend:

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

    r61411 r61610  
    10011001        if ( ( ! $errors->has_errors() ) && isset( $_POST['pass1'] ) && ! empty( $_POST['pass1'] ) ) {
    10021002            reset_password( $user, $_POST['pass1'] );
    1003             setcookie( $rp_cookie, ' ', time() - YEAR_IN_SECONDS, $rp_path, COOKIE_DOMAIN, is_ssl(), true );
    10041003            login_header(
    10051004                __( 'Password Reset' ),
     
    14881487        }
    14891488
     1489
     1490
     1491
     1492
     1493
     1494
     1495
     1496
    14901497        login_header( __( 'Log In' ), '', $errors );
    14911498
Note: See TracChangeset for help on using the changeset viewer.