WordPress.org

Make WordPress Core

Ticket #44517: allow-setting-username-on-url-for-login.php

File allow-setting-username-on-url-for-login.php, 559 bytes (added by datatim, 2 years ago)

allow-setting-username-on-url-for-login.php

Line 
1Index: src/wp-login.php
2===================================================================
3--- src/wp-login.php    (revision 43389)
4+++ src/wp-login.php    (working copy)
5@@ -1050,6 +1050,8 @@
6 
7                if ( isset( $_POST['log'] ) ) {
8                        $user_login = ( 'incorrect_password' == $errors->get_error_code() || 'empty_password' == $errors->get_error_code() ) ? esc_attr( wp_unslash( $_POST['log'] ) ) : '';
9+               } elseif ( isset( $_GET['username'] ) ) {
10+                       $user_login = esc_attr( wp_unslash( $_GET['username'] ) );
11                }
12                $rememberme = ! empty( $_POST['rememberme'] );
13