Created
August 30, 2013 20:44
-
-
Save achilles283/6394106 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
function your_last_login($login) { global $user_ID; $user = get_userdatabylogin($login); update_usermeta($user->ID, 'last_login', current_time('mysql'));}add_action('wp_login','your_last_login');function get_last_login($user_id) { $last_login = get_user_meta($user_id, 'last_login', true); $date_format = get_option('date_format') . ' ' . get_option('time_format'); $the_last_login = mysql2date($date_format, $last_login, false); echo $the_last_login;} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment