Automattic\WooCommerce\Vendor\Detection

MobileDetect::matchDetectionRulesAgainstUAprotectedWC 1.0

Find a detection rule that matches the current User-agent.

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

Хуков нет.

Возвращает

true|false.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->matchDetectionRulesAgainstUA( ?string $userAgent ): bool;
?string $userAgent
.
По умолчанию: null

Код MobileDetect::matchDetectionRulesAgainstUA() WC 10.0.2

protected function matchDetectionRulesAgainstUA(?string $userAgent = null): bool
{
    // Begin general search.
    foreach ($this->getRules() as $_regex) {
        if (empty($_regex)) {
            continue;
        }

        if ($this->match($_regex, $userAgent)) {
            return true;
        }
    }

    return false;
}