Automattic\Jetpack\Device_Detection
User_Agent_Info::is_opera_mini()
Detects if the current browser is Opera Mini
Opera/8.01 (J2ME/MIDP; Opera Mini/3.0.6306/1528; en; U; ssr) Opera/9.80 (Android;Opera Mini/6.0.24212/24.746 U;en) Presto/2.5.25 Version/10.5454 Opera/9.80 (iPhone; Opera Mini/5.0.019802/18.738; U; en) Presto/2.4.15 Opera/9.80 (J2ME/iPhone;Opera Mini/5.0.019802/886; U; ja) Presto/2.4.15 Opera/9.80 (J2ME/iPhone;Opera Mini/5.0.019802/886; U; ja) Presto/2.4.15 Opera/9.80 (Series 60; Opera Mini/5.1.22783/23.334; U; en) Presto/2.5.25 Version/10.54 Opera/9.80 (BlackBerry; Opera Mini/5.1.22303/22.387; U; en) Presto/2.5.25 Version/10.54
Method of the class: User_Agent_Info{}
No Hooks.
Return
null
. Nothing (null).
Usage
$result = User_Agent_Info::is_opera_mini();
User_Agent_Info::is_opera_mini() User Agent Info::is opera mini code WPSCache 1.12.4
public static function is_opera_mini() { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { return false; } $ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating. if ( strpos( $ua, 'opera' ) !== false && strpos( $ua, 'mini' ) !== false ) { return true; } else { return false; } }