convert_invalid_entities

函数


convert_invalid_entities ( $content )
参数
  • (string)
    $content
    String with entities that need converting.
    Required:
返回值
  • (string) Converted string.
定义位置
  • wp-includes/formatting.php
    , line 2462
引入
4.3.0
弃用

Converts invalid Unicode references range to valid range.

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

	return $content;
}