Skip to content

Instantly share code, notes, and snippets.

@hannit
Created January 9, 2017 10:35
Show Gist options
  • Save hannit/8df9040e9c0526ab4d7b4c475d996643 to your computer and use it in GitHub Desktop.
Save hannit/8df9040e9c0526ab4d7b4c475d996643 to your computer and use it in GitHub Desktop.
add_action('wp_login','user_last_login', 0, 2);
function user_last_login($login, $user) {
$user = get_user_by('login',$login);
$now = time();
update_usermeta( $user->ID, 'user_last_login', $now );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment