Automattic\WPSC\Device_Detection
User_Agent_Info::get_desktop_platform
Returns the platform for desktops
Method of the class: User_Agent_Info{}
No Hooks.
Returns
String.
Usage
$User_Agent_Info = new User_Agent_Info(); $User_Agent_Info->get_desktop_platform();
User_Agent_Info::get_desktop_platform() User Agent Info::get desktop platform code WPSCache 3.1.0
public function get_desktop_platform() {
$ua = $this->useragent;
if ( empty( $ua ) ) {
return false;
}
$platform = self::OTHER;
if ( static::is_linux_desktop( $ua ) ) {
$platform = self::PLATFORM_DESKTOP_LINUX;
} elseif ( static::is_mac_desktop( $ua ) ) {
$platform = self::PLATFORM_DESKTOP_MAC;
} elseif ( static::is_windows_desktop( $ua ) ) {
$platform = self::PLATFORM_DESKTOP_WINDOWS;
} elseif ( static::is_chrome_desktop( $ua ) ) {
$platform = self::PLATFORM_DESKTOP_CHROME;
}
return $platform;
}