I can’t seem to find this in the codex, nor in the get_user_field info. I’m attempting to add an action that makes decisions based on last login time.
Perhaps something like: $user->user_last_login_time ???
TIA!
I can’t seem to find this in the codex, nor in the get_user_field info. I’m attempting to add an action that makes decisions based on last login time.
Perhaps something like: $user->user_last_login_time ???
TIA!
You’ll find it in usermeta: s2member_last_login_time
THANKS Pat!
Hmmmmm? The dreaded usermeta data. Is that one of the infamous serialized arrays?
If you were to traverse the database and wanted to inspect each user’s last_login_time, how would you do that. For example, I would inspect simpler data (i.e. registrations older than 6 months) like this:
foreach(get_users(‘role=subscriber’) as $user)
if(strtotime($user->user_registered) < strtotime(’-6 months’))
maybe this?
get_user_option(“s2member_last_login_time”, $user->ID)
$lastlogin = get_user_option("s2member_last_login_time", $userid);
Echo 'Last Login Time: '.date('m-d-Y', $lastlogin);
Thanks Pat.
I discovered that by trial and error late last night. It’s not easily discovered in the s2 knowledge base.