convert_invalid_entities( string $content )

Converts invalid Unicode references range to valid range.


Description Description


Parameters Parameters

$content

(string) (Required) String with entities that need converting.


Top ↑

Return Return

(string) Converted string.


Top ↑

Source Source

File: wp-includes/formatting.php

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 ( strpos( $content, '&#1' ) !== false ) {
		$content = strtr( $content, $wp_htmltranswinuni );
	}

	return $content;
}

Top ↑

Changelog Changelog

Changelog
Version Description
4.3.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.