Automattic\WooCommerce\Vendor\Detection
MobileDetect::__construct()
Construct an instance of this class.
Method of the class: MobileDetect{}
No Hooks.
Return
null
. Nothing (null).
Usage
$MobileDetect = new MobileDetect(); $MobileDetect->__construct( $headers, $userAgent );
- $headers(array|null)
- Specify the headers as injection. Should be PHP _SERVER flavored. If left empty, will use the global _SERVER['HTTP_'] vars instead.
Default: null* - $userAgent(string|null)
- Inject the User-Agent header. If null, will use HTTP_USER_AGENT from the $headers array instead.
Default: null
MobileDetect::__construct() MobileDetect:: construct code WC 9.4.2
public function __construct(array $headers = null, string $userAgent = null) { $this->setHttpHeaders($headers); $this->setUserAgent($userAgent); }