Automattic\Jetpack\Device_Detection
User_Agent_Info::get_mobile_user_agent_name()
This method detects the mobile User Agent name.
Method of the class: User_Agent_Info{}
No Hooks.
Return
String
. The matched User Agent name, false otherwise.
Usage
$User_Agent_Info = new User_Agent_Info(); $User_Agent_Info->get_mobile_user_agent_name();
User_Agent_Info::get_mobile_user_agent_name() User Agent Info::get mobile user agent name code WPSCache 1.12.4
public function get_mobile_user_agent_name() { if ( static::is_chrome_for_iOS() ) { // Keep this check before the safari rule. return 'chrome-for-ios'; } elseif ( static::is_iphone_or_ipod( 'iphone-safari' ) ) { return 'iphone'; } elseif ( static::is_ipad( 'ipad-safari' ) ) { return 'ipad'; } elseif ( static::is_android_tablet() ) { // Keep this check before the android rule. return 'android_tablet'; } elseif ( static::is_android() ) { return 'android'; } elseif ( static::is_blackberry_10() ) { return 'blackberry_10'; } elseif ( static::is_blackbeberry() ) { return 'blackberry'; } elseif ( static::is_WindowsPhone7() ) { return 'win7'; } elseif ( static::is_windows_phone_8() ) { return 'winphone8'; } elseif ( static::is_opera_mini() ) { return 'opera-mini'; } elseif ( static::is_opera_mini_dumb() ) { return 'opera-mini-dumb'; } elseif ( static::is_opera_mobile() ) { return 'opera-mobi'; } elseif ( static::is_blackberry_tablet() ) { return 'blackberry_tablet'; } elseif ( static::is_kindle_fire() ) { return 'kindle-fire'; } elseif ( static::is_PalmWebOS() ) { return 'webos'; } elseif ( static::is_S60_OSSBrowser() ) { return 'series60'; } elseif ( static::is_firefox_os() ) { return 'firefoxOS'; } elseif ( static::is_firefox_mobile() ) { return 'firefox_mobile'; } elseif ( static::is_MaemoTablet() ) { return 'maemo'; } elseif ( static::is_MeeGo() ) { return 'meego'; } elseif ( static::is_TouchPad() ) { return 'hp_tablet'; } elseif ( static::is_facebook_for_iphone() ) { return 'facebook-for-iphone'; } elseif ( static::is_facebook_for_ipad() ) { return 'facebook-for-ipad'; } elseif ( static::is_twitter_for_iphone() ) { return 'twitter-for-iphone'; } elseif ( static::is_twitter_for_ipad() ) { return 'twitter-for-ipad'; } elseif ( static::is_wordpress_for_ios() ) { return 'ios-app'; } elseif ( static::is_iphone_or_ipod( 'iphone-not-safari' ) ) { return 'iphone-unknown'; } elseif ( static::is_ipad( 'ipad-not-safari' ) ) { return 'ipad-unknown'; } elseif ( static::is_Nintendo_3DS() ) { return 'nintendo-3ds'; } else { $agent = $this->useragent; $dumb_agents = $this->dumb_agents; foreach ( $dumb_agents as $dumb_agent ) { if ( false !== strpos( $agent, $dumb_agent ) ) { return $dumb_agent; } } } return false; }