wp_kses_normalize_entities3

Callback for wp_kses_normalize_entities() for regular expression.

Description

(string) wp_kses_normalize_entities3( (array) $matches ); 

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

Returns (string)

Correctly encoded entity

Parameters (1)

0. $matches (array)
Preg_replace_callback() matches array

Usage

  1. if ( !function_exists( 'wp_kses_normalize_entities3' ) ) { 
  2. require_once ABSPATH . WPINC . '/kses.php'; 
  3.  
  4. // preg_replace_callback() matches array 
  5. $matches = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wp_kses_normalize_entities3($matches); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/kses.php  
  1. function wp_kses_normalize_entities2($matches) { 
  2. if ( empty($matches[1]) ) 
  3. return ''; 
  4.  
  5. $i = $matches[1]; 
  6. if (valid_unicode($i)) { 
  7. $i = str_pad(ltrim($i, '0'), 3, '0', STR_PAD_LEFT);