Created
July 16, 2020 01:02
-
-
Save csaborio001/497ebfdab7ccfd44263933877264471e 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
<?php | |
add_action( 'wp_login', 'wppb_toolbox_count_user_logins', 20, 2 ); | |
function wppb_toolbox_count_user_logins( $user_login, $user ) { | |
if ( empty($user->ID) ) return; | |
$now = new DateTime( 'now', wp_timezone() ); | |
update_user_meta( $user->ID, 'last_login_date', $now->format( 'Y-m-d H:i:s' ) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment