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

Method of the class: User_Agent_Info{}

No Hooks.

Return

null. Nothing (null).

Usage

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

User_Agent_Info::is_iphoneOrIpod() code WPSCache 1.12.0

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;
	}
}