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



convert_invalid_entities › WordPress Function

Da4.3.0
Deprecaton/a
convert_invalid_entities ( $content )
Parametri:
  • (string) $content String with entities that need converting.
    Richiesto:
Ritorna:
  • (string) Converted string.
Definito a:
Codex:

Converts invalid Unicode references range to valid range.



Sorgenti

function convert_invalid_entities( $content ) {
	$wp_htmltranswinuni = array(
		'€' => '€', // The Euro sign.
		'' => '',
		'‚' => '‚', // These are Windows CP1252 specific characters.
		'ƒ' => 'ƒ',  // They would look weird on non-Windows browsers.
		'„' => '„',
		'…' => '…',
		'†' => '†',
		'‡' => '‡',
		'ˆ' => 'ˆ',
		'‰' => '‰',
		'Š' => 'Š',
		'‹' => '‹',
		'Œ' => 'Œ',
		'' => '',
		'Ž' => 'Ž',
		'' => '',
		'' => '',
		'‘' => '‘',
		'’' => '’',
		'“' => '“',
		'”' => '”',
		'•' => '•',
		'–' => '–',
		'—' => '—',
		'˜' => '˜',
		'™' => '™',
		'š' => 'š',
		'›' => '›',
		'œ' => 'œ',
		'' => '',
		'ž' => 'ž',
		'Ÿ' => 'Ÿ',
	);

	if ( str_contains( $content, '&#1' ) ) {
		$content = strtr( $content, $wp_htmltranswinuni );
	}

	return $content;
}