Advertisement
swte

Untitled

May 11th, 2025
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.36 KB | None | 0 0
  1. add_filter('mhcookie/geolocation', function($result) {
  2.     if (!empty($_SERVER['HTTP_USER_AGENT'])) {
  3.         $pattern = '/(Googlebot|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Sogou|Exabot|facebot|ia_archiver)/i';
  4.  
  5.         if (preg_match($pattern, $_SERVER['HTTP_USER_AGENT'])) {
  6.             return 'true';
  7.         }
  8.     }
  9.  
  10.     return $result;
  11. });
  12.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement