Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. function check_login($user,$username,$password,$uid)
  2. {
  3. if(!empty($user)) $user_data=$user->data;
  4. $adminveri=get_user_meta($uid,'admin_status');
  5. $emailveri=get_user_meta($uid,'email_status');
  6. if($adminveri[0]==0) or $emailveri[0]==0 )
  7. {
  8. return null;
  9. }
  10. else
  11. {
  12. return $user;
  13. }
  14. }
  15.  
  16. add_action( 'wp_login', 'wpse_112895_validate_user', 10, 2 );
  17.  
  18. function wpse_112895_validate_user( $login, $user ) {
  19. $meta = get_user_meta( $user->ID, 'adminveri', true );
  20.  
  21. // not verified, log them out!
  22. if ( $meta != 0 )
  23. wp_logout();
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement