WPSEO_Metabox::is_internet_explorer()public staticYoast 1.0

Checks whether the request comes from an IE 11 browser.

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

Хуков нет.

Возвращает

true|false. Whether the request comes from an IE 11 browser.

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

$result = WPSEO_Metabox::is_internet_explorer();

Код WPSEO_Metabox::is_internet_explorer() Yoast 19.11

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

	$user_agent = sanitize_text_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) );

	if ( stripos( $user_agent, 'Trident/7.0' ) === false ) {
		return false;
	}

	return true;
}