Automattic\Jetpack\Device_Detection

User_Agent_Info::is_kindle_fire()public staticWPSCache 1.0

Detects if the current browser is the Kindle Fire Native browser.

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-84) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=true Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-84) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=false

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

Хуков нет.

Возвращает

true|false. true if the browser is Kindle Fire Native browser otherwise false

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

$result = User_Agent_Info::is_kindle_fire();

Код User_Agent_Info::is_kindle_fire() WPSCache 1.12.0

public static function is_kindle_fire() {
	if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
		return false;
	}

	$agent        = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating.
	$pos_silk     = strpos( $agent, 'silk/' );
	$pos_silk_acc = strpos( $agent, 'silk-accelerated=' );
	if ( false !== $pos_silk && false !== $pos_silk_acc ) {
		return true;
	} else {
		return false;
	}
}