You don’t want to be messing around with that.
Look at the following hook:
https://codex.wordpress.org/Plugin_API/Action_Reference/wp_login
You should do something like:
function check_test_user() {
// Your code here
}
add_action('wp_login', 'check_test_user');
The hook will run as part of the Login process and saves you modifying core WordPress files.
Related Posts:
- Disable WordPress 3.6 idle logout / login modal window / session expiration
- How to fake a WordPress login?
- Is wp_login_form secure on a non secure page?
- Custom user roles are unable to login
- Hide wp-login.php but not the widget
- Can I programmatically login a user without a password?
- How can I redirect user after entering wrong password?
- Custom login form
- Adding extra authentication field in login page
- Prevent wp_login_form() from redirecting to wp-admin when there are errors
- What exactly is ReAuth?
- How do I change the language of only the login page?
- Can not login with correct username and password
- How can I add a custom script to footer of login page?
- Brute force attack?
- Need to execute a cron job
- How to keep always logged in development environment
- Log in from one wordpress website to another wordpress website
- custom login page redirect to logged in user profile page
- How to customise wp-login.php only for users who are setting a password for the first time?
- WordPress Login Footer URL
- Remove built in wordpress login and use only google auth
- Websites defaced by uploading script using theme editor
- Change Login Page for a Multisite Subsite
- send users logging in from wp-login.php directly to home page of site, rather than dashboard
- How to get login data (session) outside WordPress?
- Calling wp_signon doesn’t log the user in
- WordPress login urls
- Are there ways of logging in that bypass wp-login.php altogether?
- Add class to input form in login form
- Allow access to a page for admins only
- Customizing login error messages
- Store brute-force IP addresses
- Customizing the WordPress login form
- how to restrict user login whenever if a user puts on hold by editing wp-login action?
- How to display username and password after registration
- How to create a private login page for admin.?
- WordPress Security – How to block alternative WordPress access
- deny IPs from wp-login using .htaccess
- Protecting WordPress login page
- Login error redirecting to wp-login page
- How can I prevent my custom form from redirecting to wp-login?
- reset password link redirect to login page
- Custom Login iframe doesn’t work
- Password reset – Disabled for LDAP accounts
- Replace dash with space in username on login
- Autologin only working the second time
- replace wp-login.php login forms via a hook & use custom forms with wp-login form validation
- disable site_url redirect in wp-login.php
- Auto login between word press subdomain and a .net website
- Two factor authentication
- Disabling standard registration login with username/email and password?
- WordPress error on log out ‘Not Permitted’ and can’t log out
- Redirect wp-login
- Is the login encrypted before it is sent? If so how to do I encrypt it the same way?
- How to generate “WP_Error” Object for user login?
- Is there anyway to get the inputted password string from the login form?
- Login and Forgot password in Lightbox
- Forcing frontend login with UI switch
- How can I password protect a WordPress site without requiring users to log in?
- Prevent display password on wp-login.php
- Change default login auth
- WordPress SSL not working [closed]
- Error on WordPress Login
- Access log “POST /wp-login.php HTTP/1.0” 400
- I want login using email not username wordpress front end
- Reloading page with a query string upon login for admins
- force login loophole
- Alert Message through email or phone(Message)
- WordPress authentication using custom php?
- Moving from one host to another – cannot access the dashboard
- How are all users now set to inactive?
- I need to find which is the file that checks the DB for correct login (username, password)
- How to create separate login for authors/moderators/subscribers?
- woocommerce store login not working at first time
- How do I change the language of the login page to Arabic?
- How to post frontend login form to a different authentication script from wp-login?
- How to add custom authentication to wordpress login and register
- Problem in auto login after registration
- Login form does not store/remember/suggest users password
- Basic Auth .htaccess on wp-login, but allow logout from woocommerce
- How to invalidate `password reset key` after being used
- how to add security questions on wp-registration page and validate it
- Extend Cookie with auth_cookie_expiration not working
- Special link for no automatic login (no username and no password)
- Modify wp-login.php Labels Conditionally Based On Referring URL
- WordPress Login & Register works in localhost but don’t work on server
- How to login to wordpress via Cpanel
- Can we start session from another php site to wordpress blog site?
- Site is not loading after relogin attempts on SSL
- Make WordPress User Name the Email Address When Register
- How to place wp-login.php in page or page template?
- Webpage not found upon entering wrong username and password on custom login form?
- Can’t login through wp-login.php on fresh installation
- Securely log in a user without a password using a link?
- Logging in takes a few refreshes to show you are logged in, is this a cache issue? [closed]
- Handle POST request sent from an external site for login?
- Login and register by API
- Remove login link from Reset Password-screen
- Why am I not able to login to the admin