Display a user’s email address in the WordPress login form

When you’re already logged in to your WordPress site and visit the login page, WordPress will handily auto-fill the form with your username.

2016-08-03 at 6.12 AM

However, if you’re randomly generating usernames for your users, you might want to present their email address instead of the username. Doing so requires temporarily modifying the $user_login global.