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
if ( !function_exists( 'wp_kses_named_entities' ) ) { require_once ABSPATH . WPINC . '/kses.php'; } // preg_replace_callback() matches array $matches = array(); // NOTICE! Understand what this does before running. $result = wp_kses_named_entities($matches);
Defined (1)
The function is defined in the following location(s).
- /wp-includes/kses.php
- function wp_kses_named_entities($matches) {
- global $allowedentitynames;
- if ( empty($matches[1]) )
- return '';
- $i = $matches[1];
- return ( ! in_array( $i, $allowedentitynames ) ) ? "&$i;" : "&$i;";
- }