Automattic\WooCommerce\Vendor\Detection
MobileDetect::is()
This method checks for a certain property in the userAgent.
Method of the class: MobileDetect{}
No Hooks.
Return
true|false
.
Usage
$MobileDetect = new MobileDetect(); $MobileDetect->is( $key, $userAgent, $httpHeaders ): bool;
- $key(string) (required)
- -
- $userAgent(string|null)
- deprecated
Default: null - $httpHeaders(array|null)
- deprecated
Default: null
MobileDetect::is() MobileDetect::is code WC 9.4.2
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); }