Automattic\Jetpack\Device_Detection
User_Agent_Info::is_chrome_desktop()
Determines whether a desktop platform is Chrome OS
Метод класса: User_Agent_Info{}
Хуков нет.
Возвращает
true|false
.
Использование
$result = User_Agent_Info::is_chrome_desktop();
Код User_Agent_Info::is_chrome_desktop() User Agent Info::is chrome desktop WPSCache 1.12.4
public static function is_chrome_desktop() { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { return false; } if ( ! preg_match( '/chrome/i', wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. return false; } return true; }