Automattic\Jetpack\Device_Detection

User_Agent_Info::is_kindle_touch()public staticWPSCache 1.0

Detects if the current browser is the Kindle Touch Native browser

Mozilla/5.0 (X11; U; Linux armv7l like Android; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Version/5.0 Safari/533.2+ Kindle/3.0+

{} It's a method of the class: User_Agent_Info{}

No Hooks.

Return

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

Usage

$result = User_Agent_Info::is_kindle_touch();

Code of User_Agent_Info::is_kindle_touch() WPSCache 1.9.1

public static function is_kindle_touch() {
	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_kindle_touch = strpos( $agent, 'kindle/3.0+' );
	if ( false !== $pos_kindle_touch && false === self::is_kindle_fire() ) {
		return true;
	} else {
		return false;
	}
}