Automattic\Jetpack\Device_Detection

User_Agent_Info::is_iphoneOrIpod()publicWPSCache 1.0

Detects if the current UA is the default iPhone or iPod Touch Browser.

DEPRECATED: use is_iphone_or_ipod

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

Хуков нет.

Возвращает

null. Ничего.

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

$User_Agent_Info = new User_Agent_Info();
$User_Agent_Info->is_iphoneOrIpod();

Код User_Agent_Info::is_iphoneOrIpod() WPSCache 1.9.1

public function is_iphoneOrIpod() {
	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 ( ( strpos( $ua, 'iphone' ) !== false ) || ( strpos( $ua, 'ipod' ) !== false ) ) {
		if ( self::is_opera_mini() || self::is_opera_mobile() || self::is_firefox_mobile() ) {
			return false;
		} else {
			return true;
		}
	} else {
		return false;
	}
}