Automattic\WooCommerce\Vendor\Detection

MobileDetect::ispublicWC 1.0

This method checks for a certain property in the userAgent.

Method of the class: MobileDetect{}

No Hooks.

Returns

true|false.

Usage

$MobileDetect = new MobileDetect();
$MobileDetect->is( $key, ?string $userAgent, ?array $httpHeaders ): bool;
$key(string) (required)
.
?string $userAgent
.
Default: null
?array $httpHeaders
.
Default: null

MobileDetect::is() code WC 9.9.5

public function is(string $key, ?string $userAgent = null, ?array $httpHeaders = null): bool
{
    // Set the UA and HTTP headers only if needed (eg. batch mode).
    if ($httpHeaders) {
        $this->setHttpHeaders($httpHeaders);
    }

    if ($userAgent) {
        $this->setUserAgent($userAgent);
    }

    return $this->matchUAAgainstKey($key);
}