wp_kses_decode_entities( string $content ): string

Converts all numeric HTML entities to their named counterparts.


Description

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.


Top ↑

Parameters

$content string Required
Content to change entities.

Top ↑

Return

string Content after decoded entities.


Top ↑

Source

File: wp-includes/kses.php. View all references

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;
}

Top ↑

Changelog

Changelog
Version Description
1.0.0 Introduced.

Top ↑

User Contributed Notes

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