Automattic\WPSC\Device_Detection
User_Agent_Info::__construct
The constructor.
Method of the class: User_Agent_Info{}
No Hooks.
Returns
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 3.1.0
public function __construct( $ua = '' ) {
if ( $ua ) {
$this->useragent = $ua;
} elseif ( ! empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
$this->useragent = wp_unslash( $_SERVER['HTTP_USER_AGENT'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This class is all about validating.
}
}