Un motore di ricerca WordPress per sviluppatori e autori di temi



wp_kses_normalize_entities2 ›

Da1.0.0
Deprecaton/a
wp_kses_normalize_entities2 ( $matches )
Accedi:
  • private
Parametri:
  • (array) $matches `preg_replace_callback()` matches array.
    Richiesto:
Ritorna:
  • (string) Correctly encoded entity.
Definito a:
Codex:

Callback for `wp_kses_normalize_entities()` regular expression.

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



Sorgenti

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