Created
November 22, 2011 21:12
-
-
Save wpscholar/1386981 to your computer and use it in GitHub Desktop.
WordPress - Store timestamp of a user's last login as user meta
This file contains hidden or 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
<?php | |
/** | |
* WordPress - Store timestamp of a user's last login as user meta | |
*/ | |
function user_last_login( $user_login, $user ){ | |
update_user_meta( $user->ID, '_last_login', time() ); | |
} | |
add_action( 'wp_login', 'user_last_login', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment