Automattic\WooCommerce\Vendor\Detection
MobileDetect::matchDetectionRulesAgainstUA
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() MobileDetect::matchDetectionRulesAgainstUA WC 10.9.4
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;
}