Reputation: 59
I have my site in WordPress and i have created a forum page in it for user discussion by using default wordpress comment system. Now in my forum page I want to check whether the commentator user is online or not in real time and also show its status in real time in front of its user Id by using simple text [Online/Offline].
Is it possible to display current status of commentator user in WordPress default comment system. Can anybody help me....
Upvotes: 0
Views: 74
Reputation: 27112
You can use is_user_logged_in()
to determine whether or not someone is logged in...
However, if you need to check whether or not the user has your site open at the moment, you may need to add a filter to auth_cookie_expiration
, to change the auth cookie expiration rules. Read more on WPSE.
Upvotes: 2