Created
January 9, 2017 10:35
-
-
Save hannit/8df9040e9c0526ab4d7b4c475d996643 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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