WordPress开发者和主题制作者的搜索引擎



wp_kses_normalize_entities3 ›

Since2.7.0
已弃用n/a
wp_kses_normalize_entities3 ( $matches )
访问:
  • private
参数:
  • (array) $matches `preg_replace_callback()` matches array.
    Required: Yes
返回:
  • (string) Correctly encoded entity.
定义在:
文档:

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.



源码

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