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?
- Is there any way to rename or hide wp-login.php?
- How can I redirect user after entering wrong password?
- Increase of failed login attempts, brute force attacks? [closed]
- What is $interim_login?
- 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?
- Login members using web services
- How do I change the language of only the login page?
- How to pass users back and forth using session data?
- Avoid to load default WP styles in login screen
- 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
- I want to disable E-Mail verifcation / activation when a user signs up for my WordPress site
- custom login page redirect to logged in user profile page
- Receiving “This content cannot be displayed in a frame” error on login page
- Action wp_login_failed not working if only one field is filled out
- 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
- Make wordpress admin failed login attempt return 401
- Change Login Page for a Multisite Subsite
- Positioning the “Lost your password?” and “← Back to Site”
- send users logging in from wp-login.php directly to home page of site, rather than dashboard
- how to update current logged user username
- Validate Custom Login field
- How to get login data (session) outside WordPress?
- Calling wp_signon doesn’t log the user in
- How to implement Google reCaptcha without installing a plugin?
- Is it possible a one click user registration with Facebook or Twitter (or other Social Networks)?
- 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
- Restricting frontend acess based on user role otherwise redirect to 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.?
- How do I force “users must be registered and logged in” on subsites?
- WordPress Security – How to block alternative WordPress access
- deny IPs from wp-login using .htaccess
- Protecting WordPress login page
- Passing username to login screen
- Login error redirecting to wp-login page
- wp-admin folder, brute force, and password protection
- Sniffing wordpress user’s credentials
- How can I prevent my custom form from redirecting to wp-login?
- reset password link redirect to login page
- How do I replace “Username” in the WordPress login form?
- Custom Login iframe doesn’t work
- Password reset – Disabled for LDAP accounts
- How to Get Logged-in to “Remote WP Site” from my local script (in Same Browser)?
- 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?
- How to change wordpress Log In text
- WordPress error on log out ‘Not Permitted’ and can’t log out
- Redirect wp-login
- Does WordPress (or a plugin) reveal login credentials to admin?
- Is the login encrypted before it is sent? If so how to do I encrypt it the same way?
- WordPress login security
- Why isn’t the login page rate limited by default?
- Form Action submit over https
- 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?
- Input sanitation
- How to Prevent Brute Force Attack on WordPress
- Prevent display password on wp-login.php
- Advice on redirect to lock site from unauthorized users
- Possibility to login without password
- Change default login auth
- wordpress login without password just email address (NO 2 factor authentication with email)
- Allow Access to Home Page and Login Screen but Nothing Else (unless logged in)
- 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