This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

wp_kses_normalize_entities3( array $matches )

Callback for wp_kses_normalize_entities() for regular expression.


Description

This function helps wp_kses_normalize_entities() to only accept valid Unicode numeric entities in hex form.


Parameters

$matches

(Required) preg_replace_callback() matches array


Return

(string) Correctly encoded entity


Source

File: wp-includes/kses.php

function wp_kses_normalize_entities3($matches) {
	if ( empty($matches[1]) )
		return '';

	$hexchars = $matches[1];
	return ( ! valid_unicode( hexdec( $hexchars ) ) ) ? "&#x$hexchars;" : '&#x'.ltrim($hexchars,'0').';';
}


Changelog

Changelog
Version Description
WP-2.7.0 Introduced.