Automattic\Jetpack\Device_Detection

User_Agent_Info::is_opera_desktop()public staticWPSCache 1.0

Detect modern Opera desktop

Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36 OPR/74.0.3911.203

Looking for "OPR/" specifically.

Метод класса: User_Agent_Info{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$result = User_Agent_Info::is_opera_desktop();

Код User_Agent_Info::is_opera_desktop() WPSCache 1.12.0

public static function is_opera_desktop() {
	if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
		return false;
	}

	if ( false === strpos( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ), 'OPR/' ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating.
		return false;
	}

	return true;
}