Un motore di ricerca WordPress per sviluppatori e autori di temi



wp_kses_normalize_entities3 ›

Da2.7.0
Deprecaton/a
wp_kses_normalize_entities3 ( $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()` for regular expression.

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



Sorgenti

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' ) . ';';
}