AeliaCurrencySwitcher.php
4 years ago
BeaverBuilder.php
4 years ago
CF_Helper.php
4 years ago
Cloudflare.php
4 years ago
CookieNotice.php
4 years ago
DownloadManager.php
4 years ago
Ezoic.php
4 years ago
FusionBuilder.php
4 years ago
NginxHelper.php
4 years ago
RC.php
4 years ago
RocketNet_Helper.php
4 years ago
ShortPixel.php
4 years ago
ThriveTheme.php
4 years ago
WPCacheHelper.php
4 years ago
WPRocket.php
4 years ago
Woocommerce.php
4 years ago
WoocommerceCacheHandler.php
4 years ago
FusionBuilder.php
29 lines
| 1 | <?php |
| 2 | |
| 3 | namespace NitroPack\Integration\Plugin; |
| 4 | |
| 5 | class FusionBuilder { |
| 6 | const STAGE = "late"; |
| 7 | |
| 8 | public function init($stage) { |
| 9 | add_action( 'init', function() { |
| 10 | if (defined('FUSION_BUILDER_VERSION')) { |
| 11 | add_filter("jetpack_device_detection_get_info", function($info, $ua, $ua_info) { |
| 12 | $agent = $ua_info->useragent; |
| 13 | if ($agent |
| 14 | && stripos($agent, "Nitro-Optimizer-Agent") !== false |
| 15 | && stripos($agent, "Android") === false |
| 16 | && stripos($agent, "iPad") === false |
| 17 | ) { |
| 18 | $info["is_phone"] = false; |
| 19 | $info["is_phone_matched_ua"] = ""; |
| 20 | $info["is_handheld"] = false; |
| 21 | $info["is_desktop"] = true; |
| 22 | } |
| 23 | return $info; |
| 24 | }, 10, 3); |
| 25 | } |
| 26 | }, 5); |
| 27 | } |
| 28 | } |
| 29 |