wp_kses_named_entities

Callback for wp_kses_normalize_entities() regular expression.

Description

(string) wp_kses_named_entities( (array) $matches ); 

This function only accepts valid named entity references, which are finite, case-sensitive, and highly scrutinized by HTML and XML validators.

Returns (string)

Correctly encoded entity

Parameters (1)

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

Usage

  1. if ( !function_exists( 'wp_kses_named_entities' ) ) { 
  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_named_entities($matches); 
  9.  

Defined (1)

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

/wp-includes/kses.php  
  1. function wp_kses_named_entities($matches) { 
  2. global $allowedentitynames; 
  3.  
  4. if ( empty($matches[1]) ) 
  5. return ''; 
  6.  
  7. $i = $matches[1]; 
  8. return ( ! in_array( $i, $allowedentitynames ) ) ? "&$i;" : "&$i;";