Automattic\Jetpack\Device_Detection
User_Agent_Info::__construct()
The constructor.
Method of the class: User_Agent_Info{}
No Hooks.
Return
null
. Nothing (null).
Usage
$User_Agent_Info = new User_Agent_Info(); $User_Agent_Info->__construct( $ua );
- $ua(string)
- (Optional) User agent.
Default: ''
User_Agent_Info::__construct() User Agent Info:: construct code WPSCache 1.12.4
public function __construct( $ua = '' ) { if ( $ua ) { $this->useragent = $ua; } elseif ( ! empty( $_SERVER['HTTP_USER_AGENT'] ) ) { $this->useragent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This class is all about validating. } }