Automattic\Jetpack\Device_Detection

User_Agent_Info::is_linux_desktop()public staticWPSCache 1.0

Determines whether a desktop platform is Linux OS

Метод класса: User_Agent_Info{}

Хуков нет.

Возвращает

true|false.

Использование

$result = User_Agent_Info::is_linux_desktop();

Код User_Agent_Info::is_linux_desktop() WPSCache 1.12.4

public static function is_linux_desktop() {
	if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
		return false;
	}
	if ( ! preg_match( '/linux/i', wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating.
		return false;
	}
	return true;
}