Automattic\WooCommerce\Vendor\Detection

MobileDetect::ispublicWC 1.0

This method checks for a certain property in the userAgent.

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

Хуков нет.

Возвращает

true|false.

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

$MobileDetect = new MobileDetect();
$MobileDetect->is( $key, ?string $userAgent, ?array $httpHeaders ): bool;
$key(строка) (обязательный)
.
?string $userAgent
.
По умолчанию: null
?array $httpHeaders
.
По умолчанию: null

Код MobileDetect::is() WC 10.9.4

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