Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function check_login($user,$username,$password,$uid)
- {
- if(!empty($user)) $user_data=$user->data;
- $adminveri=get_user_meta($uid,'admin_status');
- $emailveri=get_user_meta($uid,'email_status');
- if($adminveri[0]==0) or $emailveri[0]==0 )
- {
- return null;
- }
- else
- {
- return $user;
- }
- }
- add_action( 'wp_login', 'wpse_112895_validate_user', 10, 2 );
- function wpse_112895_validate_user( $login, $user ) {
- $meta = get_user_meta( $user->ID, 'adminveri', true );
- // not verified, log them out!
- if ( $meta != 0 )
- wp_logout();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement