Automattic\Jetpack\Device_Detection

User_Agent_Info::is_firefox_desktop()public staticWPSCache 1.0

Detects if the current browser is Firefox for desktop

See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent/Firefox Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion The platform section will include 'Mobile' for phones and 'Tablet' for tablets.

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

Хуков нет.

Возвращает

null. Ничего.

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

$result = User_Agent_Info::is_firefox_desktop();

Код User_Agent_Info::is_firefox_desktop() WPSCache 1.9.1

public static function is_firefox_desktop() {

	if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
		return false;
	}

	$ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating.

	if ( false !== strpos( $ua, 'firefox' ) && false === strpos( $ua, 'mobile' ) && false === strpos( $ua, 'tablet' ) ) {
		return true;
	} else {
		return false;
	}
}