wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema



_canonical_charset › WordPress Function

Desde3.6.0
Obsoleton/a
_canonical_charset ( $charset )
Acesso:
  • private
Parâmetros:
  • (string) $charset A charset name.
    Required: Yes
Ver:
Retorna:
  • (string) The canonical form of the charset.
Definido em:
Codex:

Retrieves a canonical form of the provided charset appropriate for passing to PHP functions such as htmlspecialchars() and charset HTML attributes.



Fonte

function _canonical_charset( $charset ) {
	if ( 'utf-8' === strtolower( $charset ) || 'utf8' === strtolower( $charset ) ) {

		return 'UTF-8';
	}

	if ( 'iso-8859-1' === strtolower( $charset ) || 'iso8859-1' === strtolower( $charset ) ) {

		return 'ISO-8859-1';
	}

	return $charset;
}