wp_kses_decode_entities()WP 1.0.0

Converts all numeric HTML entities to their named counterparts.

This function decodes numeric HTML entities (A and A). It doesn't do anything with named entities like ä, but we don't need them in the allowed URL protocols system anyway.

Хуков нет.


Строку. Content after decoded entities.


wp_kses_decode_entities( $content );
$content(строка) (обязательный)
Content to change entities.

Список изменений

С версии 1.0.0 Введена.

Код wp_kses_decode_entities() WP 6.3.1

function wp_kses_decode_entities( $content ) {
	$content = preg_replace_callback( '/&#([0-9]+);/', '_wp_kses_decode_entities_chr', $content );
	$content = preg_replace_callback( '/&#[Xx]([0-9A-Fa-f]+);/', '_wp_kses_decode_entities_chr_hexdec', $content );

	return $content;