Update expiration date when user logs on
-
I’m working on a site that needs to expire users who are inactive after 90 days. if a user logs in on day 53, then I need to reset their expiration date to the current date + 90 days.
The function I think might work is
function reset_expire_date() {
$e_user = new Expire_User( $user_id );
$e_user->set_expire_time_in_future( 3, ‘months’ );
}
add_action(‘wp_login’, ‘reset_expire_date’);I’m not sure how to check if the user isn’t subject to expieration ie an user whose expiration is never or not set at all. I’d also like to make the expiration date use the default Expiry Date. Any suggestions?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Update expiration date when user logs on’ is closed to new replies.