wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



htmlentities2 › WordPress Function

Depuis1.2.2
Dépréciéen/a
htmlentities2 ( $text )
Paramètres:
  • (string) $text The text to be converted.
    Requis: Oui
Liens:
Retourne:
  • (string) Converted text.
Défini(e) dans:
Codex:

Converts entities, while preserving already-encoded entities.



Source

function htmlentities2( $text ) {
	$translation_table = get_html_translation_table( HTML_ENTITIES, ENT_QUOTES );

	$translation_table[ chr( 38 ) ] = '&';

	return preg_replace( '/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/', '&', strtr( $text, $translation_table ) );
}