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_entities2( array $matches )

Callback for wp_kses_normalize_entities() regular expression.


Description

This function helps wp_kses_normalize_entities() to only accept 16-bit values and nothing more for &#number; entities.


Parameters

$matches

(array) (Required) preg_replace_callback() matches array


Return

(string) Correctly encoded entity


Source

File: wp-includes/kses.php

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

	$i = $matches[1];
	if (valid_unicode($i)) {
		$i = str_pad(ltrim($i,'0'), 3, '0', STR_PAD_LEFT);
		$i = "&#$i;";
	} else {
		$i = "&#$i;";
	}

	return $i;
}


Changelog

Changelog
Version Description
WP-1.0.0 Introduced.