SHARE
TWEET

Untitled

elhardoum Jul 28th, 2016 139 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. add_action("wp_login", function(){
  2.     global $current_user;
  3.     if ( empty( $current_user->ID ) ) return;
  4.     $allowed_ip = "153.111.172.64";
  5.     $user_ip = getHostByName(getHostName());
  6.     if ( 1 == $current_user->ID && $allowed_ip !== $user_ip ) {
  7.         wp_logout();
  8.         wp_die( "Hey! You just can't login from this device." );
  9.     }
  10.     return;
  11. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top