mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-11 18:56:10 +09:00
- fixed PHP warning when there aren't proper user while login;
This commit is contained in:
@@ -164,12 +164,15 @@ add_action( 'um_on_login_before_redirect', 'um_store_lastlogin_timestamp', 10, 1
|
||||
*/
|
||||
function um_store_lastlogin_timestamp_( $login ) {
|
||||
$user = get_user_by( 'login', $login );
|
||||
um_store_lastlogin_timestamp( $user->ID );
|
||||
|
||||
$attempts = (int) get_user_meta( $user->ID, 'password_rst_attempts', true );
|
||||
if ( $attempts ) {
|
||||
//don't create meta but update if it's exists only
|
||||
update_user_meta( $user->ID, 'password_rst_attempts', 0 );
|
||||
if ( false !== $user ) {
|
||||
um_store_lastlogin_timestamp( $user->ID );
|
||||
|
||||
$attempts = (int) get_user_meta( $user->ID, 'password_rst_attempts', true );
|
||||
if ( $attempts ) {
|
||||
//don't create meta but update if it's exists only
|
||||
update_user_meta( $user->ID, 'password_rst_attempts', 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
add_action( 'wp_login', 'um_store_lastlogin_timestamp_' );
|
||||
|
||||
Reference in New Issue
Block a user