Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Check if specific user is online outside wp

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:

  1. In Django, how do I know the currently logged-in user?
  2. Disallow user from editing their own profile information
  3. wp_signon returns user, but the user is not logged in
  4. What exactly is ReAuth?
  5. What are the differences between wp_users and wp_usermeta tables?
  6. How can I send a welcome email to a user AFTER they login for the first time?
  7. Can not login with correct username and password
  8. How to remove the WordPress logo from login and register page?
  9. Stop users from logging in from multiple locations
  10. My login form does not work
  11. Cookie settings for session across WPML subdomains using custom AJAX login
  12. Change Login Page for a Multisite Subsite
  13. Change admin login URL
  14. Is there a way to remove wp-login.php alias (login)?
  15. Login with cookie but without using WordPress code
  16. wp-admin redirecting to wp-login.php
  17. Get wordpress stored cookies for custom login
  18. wp-admin seems to be redirecting
  19. Restrict PDF links
  20. Can’t access login page after password reset
  21. Remote REST request to check login status
  22. How can I test the login for an expired session?
  23. Rendering of custom walker menu function not working properly
  24. Force user to login in home page
  25. Login as a client no dashboard menu?
  26. Allow access to a page for admins only
  27. How to edit comment_reply_link
  28. Right practice to edit WP reset password email
  29. deny IPs from wp-login using .htaccess
  30. How To Change Wp Register/Login URL Permanently To My Custom Page
  31. How can I prevent my custom form from redirecting to wp-login?
  32. Custom Login iframe doesn’t work
  33. wp-admin returns 404 [closed]
  34. What would be the best way to implement Magic Link logins in WordPress?
  35. Can’t login to WordPress without hitting the Remember Me checkbox. Potential SSL implementation bi-product
  36. disable site_url redirect in wp-login.php
  37. Forgot password needs to redirect from wp-login to a custom page
  38. Is it possible to designate the login.php as homepage?
  39. Force login for a subdirectory within wordpress install
  40. Redirect login page except on reset pass
  41. Redirect users after failed login attempt?
  42. How to secure files based on format and word in file name with wp-config or htaccess?
  43. Redirect to custom variable
  44. Get the url of custom login page in the registration page
  45. How to make wp-login.php not accessible
  46. Forcing SSL login, have to log in again from WP/BP-Admin Bar
  47. Call header and footer on wordpress default login page
  48. Notifications when someone is on the site
  49. How can I prevent anyone from logging into a WordPress failover site?
  50. How to password-protect everything except the logo
  51. Generate email on meta value update
  52. Login Redirect Error – $user->roles
  53. WordPress login security
  54. Why isn’t the login page rate limited by default?
  55. how can redirect sign in and sign out link front-end page rather then wp-login .php in comment form in wordpress
  56. Input sanitation
  57. Advice on redirect to lock site from unauthorized users
  58. Custom code needed to be executed on login and logout
  59. Sending new registration meta values to admin by email
  60. Single Time Login HELP
  61. Allow Access to Home Page and Login Screen but Nothing Else (unless logged in)
  62. Error on WordPress Login
  63. wp_login_url not working correctly
  64. Password recovery URL has error – but not found in code or db
  65. Single sign on for multiple domains
  66. Is there an application I can use to protect documents?
  67. WordPress Submitted Content
  68. Bizarre wp_signon problem
  69. Is it possible to use WordPress functions in a page template?
  70. How to change the login-URL with function.php?
  71. Login error ” There has been a critical error on this website”
  72. login with users info in a different database
  73. How show login popup to guest only and redirect logged in users?
  74. insert a WordPress page content into a pop up
  75. wp-login.php not working goes back to home page
  76. Will the same WordPress logins work after a site migration?
  77. Possible to create a login wall?
  78. All pages gives 404 except homepage and wp-login
  79. Check for $ _POST fields in a POST method form
  80. Styling WordPress login page – Can I change the markup on the login page?
  81. WP login admin name incorrect send to another page or site
  82. Custom login method appears to ignore auth_cookie_expiration
  83. Cannot login to wp-admin as redirect set to page not yet published
  84. Users can not login into wordpress website
  85. Cannot login to WP after force recovery
  86. redirect_to not Including Hashtag from URL
  87. Updating usermeta from login redirect to billing address
  88. Login / Register for specific pages
  89. WordPress login issue . Permission Problem
  90. How can I have customers log in using ONLY customer number? No password
  91. Problem with footer and login
  92. Remember me doesn’t work with www?
  93. Simplest way to create two private sections each with a common account
  94. Shared user database trick not working
  95. Login from Mobile Phone
  96. Can i login with only one account to different top leveled domain wordpress web sites?
  97. How login is possible, if I deny login page via nginx?
  98. “user not registered” when trying to login and “There has been a critical error” message on site
  99. generate an array of user login date using update_user_meta();
  100. Locked out of WordPress.com [closed]
Categories login Tags login
Remove sale signs from site in branded? [closed]
How to get terms for taxonomy

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress