Uma área de pesquisa sobre o WordPress para devs e autores do tema



wp_kses_normalize_entities3 ›

Desde2.7.0
Obsoleton/a
wp_kses_normalize_entities3 ( $matches )
Acesso:
  • private
Parâmetros:
  • (array) $matches `preg_replace_callback()` matches array.
    Required: Yes
Retorna:
  • (string) Correctly encoded entity.
Definido em:
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.



Fonte

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