You could always try using the wp_login
action hook:
function custom_check_for_user($user_login, $user) {
if($user->ID == 123) { // Where 123 is the particular user's ID
// Do something here, eg. PHP mail() function
}
}
add_action('wp_login', 'custom_check_for_user', 10, 2);
Further reading: https://codex.wordpress.org/Plugin_API/Action_Reference/wp_login
Related Posts:
- In Django, how do I know the currently logged-in user?
- Disallow user from editing their own profile information
- wp_signon returns user, but the user is not logged in
- What exactly is ReAuth?
- What are the differences between wp_users and wp_usermeta tables?
- How can I send a welcome email to a user AFTER they login for the first time?
- Can not login with correct username and password
- How to remove the WordPress logo from login and register page?
- Stop users from logging in from multiple locations
- My login form does not work
- Cookie settings for session across WPML subdomains using custom AJAX login
- Change Login Page for a Multisite Subsite
- Change admin login URL
- Is there a way to remove wp-login.php alias (login)?
- Login with cookie but without using WordPress code
- wp-admin redirecting to wp-login.php
- Get wordpress stored cookies for custom login
- wp-admin seems to be redirecting
- Restrict PDF links
- Can’t access login page after password reset
- Remote REST request to check login status
- How can I test the login for an expired session?
- Rendering of custom walker menu function not working properly
- Force user to login in home page
- Login as a client no dashboard menu?
- Allow access to a page for admins only
- How to edit comment_reply_link
- Right practice to edit WP reset password email
- deny IPs from wp-login using .htaccess
- How To Change Wp Register/Login URL Permanently To My Custom Page
- How can I prevent my custom form from redirecting to wp-login?
- Custom Login iframe doesn’t work
- wp-admin returns 404 [closed]
- What would be the best way to implement Magic Link logins in WordPress?
- Can’t login to WordPress without hitting the Remember Me checkbox. Potential SSL implementation bi-product
- disable site_url redirect in wp-login.php
- Forgot password needs to redirect from wp-login to a custom page
- Is it possible to designate the login.php as homepage?
- Force login for a subdirectory within wordpress install
- Redirect login page except on reset pass
- Redirect users after failed login attempt?
- How to secure files based on format and word in file name with wp-config or htaccess?
- Redirect to custom variable
- Get the url of custom login page in the registration page
- How to make wp-login.php not accessible
- Forcing SSL login, have to log in again from WP/BP-Admin Bar
- Call header and footer on wordpress default login page
- Notifications when someone is on the site
- How can I prevent anyone from logging into a WordPress failover site?
- How to password-protect everything except the logo
- Generate email on meta value update
- Login Redirect Error – $user->roles
- WordPress login security
- Why isn’t the login page rate limited by default?
- how can redirect sign in and sign out link front-end page rather then wp-login .php in comment form in wordpress
- Input sanitation
- Advice on redirect to lock site from unauthorized users
- Custom code needed to be executed on login and logout
- Sending new registration meta values to admin by email
- Single Time Login HELP
- Allow Access to Home Page and Login Screen but Nothing Else (unless logged in)
- Error on WordPress Login
- wp_login_url not working correctly
- Password recovery URL has error – but not found in code or db
- Single sign on for multiple domains
- Is there an application I can use to protect documents?
- WordPress Submitted Content
- Bizarre wp_signon problem
- Is it possible to use WordPress functions in a page template?
- How to change the login-URL with function.php?
- Login error ” There has been a critical error on this website”
- login with users info in a different database
- How show login popup to guest only and redirect logged in users?
- insert a WordPress page content into a pop up
- wp-login.php not working goes back to home page
- Will the same WordPress logins work after a site migration?
- Possible to create a login wall?
- All pages gives 404 except homepage and wp-login
- Check for $ _POST fields in a POST method form
- Styling WordPress login page – Can I change the markup on the login page?
- WP login admin name incorrect send to another page or site
- Custom login method appears to ignore auth_cookie_expiration
- Cannot login to wp-admin as redirect set to page not yet published
- Users can not login into wordpress website
- Cannot login to WP after force recovery
- redirect_to not Including Hashtag from URL
- Updating usermeta from login redirect to billing address
- Login / Register for specific pages
- WordPress login issue . Permission Problem
- How can I have customers log in using ONLY customer number? No password
- Problem with footer and login
- Remember me doesn’t work with www?
- Simplest way to create two private sections each with a common account
- Shared user database trick not working
- Login from Mobile Phone
- Can i login with only one account to different top leveled domain wordpress web sites?
- How login is possible, if I deny login page via nginx?
- “user not registered” when trying to login and “There has been a critical error” message on site
- generate an array of user login date using update_user_meta();
- Locked out of WordPress.com [closed]