wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



wp_get_chromium_major_version › WordPress Function

Da7.1.0
Deprecaton/a
› wp_get_chromium_major_version ( Nessun parametro )
Ritorna:
  • (int|null) The major Chrome version, or null if not a Chromium browser.
Definito a:
Codex:

Returns the major Chrome/Chromium version from the current request's User-Agent.

Matches all Chromium-based browsers (Chrome, Edge, Opera, Brave).


Sorgenti

function wp_get_chromium_major_version(): ?int {
	if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
		return null;
	}
	if ( preg_match( '#Chrome/(\d+)#', $_SERVER['HTTP_USER_AGENT'], $matches ) ) {
		return (int) $matches[1];
	}
	return null;
}