tareq1988

Block windows users from wordpress blog

Sep 25th, 2011
82
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function block_windows() {
  2.     if( preg_match( '/win/i', $_SERVER['HTTP_USER_AGENT'] ) ) {
  3.         //echo 'windows';
  4.         wp_die('Sorry, you need to be linux user to visit the blog');
  5.     } else {
  6.         //echo 'linux';
  7.     }
  8. }
  9. add_action( 'init', 'block_windows' );
RAW Paste Data