Automattic\WPSC\Device_Detection

User_Agent_Info::is_firefox_mobilepublic staticWPSCache 1.0

Detects if the current browser is Firefox Mobile (Fennec)

See http://www.useragentstring.com/pages/Fennec/ Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.1.1) Gecko/20110415 Firefox/4.0.2pre Fennec/4.0.1 Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b2pre) Gecko/20081015 Fennec/1.0a1

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$result = User_Agent_Info::is_firefox_mobile( $user_agent );
$user_agent(строка|null)
User agent string to check. If not provided, uses $_SERVER['HTTP_USER_AGENT'].
По умолчанию: null

Код User_Agent_Info::is_firefox_mobile() WPSCache 3.1.1

public static function is_firefox_mobile( $user_agent = null ) {
	$user_agent = self::maybe_get_user_agent_from_server( $user_agent );
	if ( empty( $user_agent ) ) {
		return false;
	}

	$ua = strtolower( wp_unslash( $user_agent ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating.

	if ( strpos( $ua, 'fennec' ) !== false ) {
		return true;
	} else {
		return false;
	}
}