Automattic\WooCommerce\Vendor\Detection

MobileDetect::matchDetectionRulesAgainstUA │ protected │ WC 1.0

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

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

Хуков нет.

Возвращает

bool.

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

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

Код MobileDetect::matchDetectionRulesAgainstUA() WC 11.2.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;
}