Try hooking in as soon as the user is created or updated.
<?php
function wpse_250785_sync_user_login_with_email($user_id) {
$user = new WP_User($user_id);
if ($user->user_login != $user->user_email) {
$user->user_login = $user->user_email;
wp_update_user($user);
}
}
add_action('user_register', 'wpse_250785_sync_user_login_with_email');
add_action('profile_update', 'wpse_250785_sync_user_login_with_email');
Disclaimer: Untested, but should work 😉
Related Posts:
- Custom user roles are unable to login
- Can I programmatically login a user without a password?
- What is $interim_login?
- Adding extra authentication field in login page
- What exactly is ReAuth?
- Login members using web services
- Disable WordPress 3.6 idle logout / login modal window / session expiration
- How to pass users back and forth using session data?
- Website Visible only to Registered users
- Need to execute a cron job
- moving server can not login
- Validate Custom Login field
- Calling wp_signon doesn’t log the user in
- How to implement Google reCaptcha without installing a plugin?
- How can I allow access to two user accounts using one login?
- Is it possible a one click user registration with Facebook or Twitter (or other Social Networks)?
- Are there ways of logging in that bypass wp-login.php altogether?
- Redirecting or displaying a message on first login
- How to display username and password after registration
- Password protect media attachment – share across guests
- WordPress login problem
- Two factor authentication
- How to generate “WP_Error” Object for user login?
- WordPress Login redirection according to user role
- How do you manage your pages or functions that require logged-in users?
- How to restrict access to a single for users I’ve authorized? [closed]
- Allow Access to Home Page and Login Screen but Nothing Else (unless logged in)
- Where is the php file, that does the checks for login information?
- I want login using email not username wordpress front end
- Reloading page with a query string upon login for admins
- Sign in with social media accounts without creating a WP account [closed]
- WordPress authentication using custom php?
- authenticate user without redirecting
- Multiple issues with Ajax login function due to browsers and cookies
- How to post frontend login form to a different authentication script from wp-login?
- Using WordPress login for a non word-press website
- Extend Cookie with auth_cookie_expiration not working
- Can we start session from another php site to wordpress blog site?
- How to password protect pages in WordPress
- How to lock WordPress front-end with login and password?
- Opening protected page with cookie?
- Handle POST request sent from an external site for login?
- External Authentication
- Creating Custom Login Form Where Password Field is Dropdown Menu
- Login and register by API
- How to prefill WordPress registration with social details
- Redirect user using the ‘wp_login_failed’ action hook if the error is ’empty_username’ or ’empty_password’
- wp_signon() does not authenticate user guidance needed
- WordPress auto login after registration not working
- Avoid to load default WP styles in login screen
- How to check WordPress website username and password is correct
- Integrate recaptcha and wp_signon – what is needed?
- Programmatically log in a wordpress user
- Custom Reset Password & Forgot Password Front End Forms
- Restricting access to content
- Admin user getting message ‘You need a higher level of permission’
- Problem with logging in WP users automatically
- advance membership managment
- wp_authenticate but not logged in
- Remove WordPress Login Animation
- Redirect users to a front end wp login page
- Deny a user role to log in after register
- Force Users to Login – loop problem
- How do I replace “Username” in the WordPress login form?
- How can I do a URL redirection when an user uses wrong login details?
- Change login_message using title
- Changing WP login credential [closed]
- Index page and random posts needs a forced refresh in order to show new content
- Can I (and should I) change the login-URL from functions.php?
- WordPress Cant access wp-login.php
- How to remove ‘wordpress…’ text from page titles in tabs
- Using gettext to translate wp-login.php can’t translate `Back to` into other language
- Code for Log Out Button Yields Strange URL
- How can I insert wordpress login screen on a different domain?
- Password recovery URL has error – but not found in code or db
- Cannot Get User id after login success in file wp_login.php
- This webpage has a redirect loop issue
- define two login page url
- Logging in to the frontend works correctly but not for WP-Admin
- I can’t access my wp-admin dashboard
- Cannot login to WordPress on one device: login refreshes/an error was encountered whilst trying to authenticate
- I can’t log in to `wp-admin` after changing my domain
- My wordpress site crashes when I login!
- End session screen not close automatically after login
- Unable to login with email address as the username – WordPress
- Using is_user_logged_in() to lock down whole site
- After moving WordPress to its own directory, login doesn’t work
- Issue logging in from second computer
- Login problem with https
- WordPress auto login user after registration only from a specific page
- throttle/limit a logged in user’s http requests to specific page on a per day basis
- User login without username, only password
- Directory authentication initially succeeded, but no valid profile was found (“get entries” procedure)
- Trim the repeated value in URL
- Warning: session_start(): Cannot send session cookie – headers already sent by
- Login to wordpress with filezilla client [closed]
- I can’t login to wordpress dashboard without SSH
- Member Area Login with Fail Message
- Username character requirements
- Remove login link from Reset Password-screen