do action when logged in user visits site
-
I am using the wp_login action hook to carry out a function when the user logs in viz :
<?php function your_function() { // your code } add_action('wp_login', 'your_function'); ?>
But if the user has ticked ‘remember me’ they don’t visit this function when they come back to the site.
So how do I carry out an action for a site visitor who is automatically logged in? Can I do something with the cookie??
I basically need to check the user_meta as they get to the site, so all I need is a hook that gives me their user_id and will then let me do a function.
Any help would be much appreciated !
- The topic ‘do action when logged in user visits site’ is closed to new replies.