wp_kses_decode_entities

Convert all entities to their character counterparts.

Description

(string) wp_kses_decode_entities( (string) $string ); 

This function decodes numeric HTML entities ('A' and A). It doesn't do anything with other entities like ä, but we don't need them in the URL protocol whitelisting system anyway.

Returns (string)

Content after decoded entities

Parameters (1)

0. $string (string)
Content to change entities

Usage

  1. if ( !function_exists( 'wp_kses_decode_entities' ) ) { 
  2. require_once ABSPATH . WPINC . '/kses.php'; 
  3.  
  4. // Content to change entities 
  5. $string = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wp_kses_decode_entities($string); 
  9.  

Defined (1)

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

/wp-includes/kses.php  
  1. function wp_kses_decode_entities($string) { 
  2. $string = preg_replace_callback('/&#([0-9]+);/', '_wp_kses_decode_entities_chr', $string); 
  3. $string = preg_replace_callback('/&#[Xx]([0-9A-Fa-f]+);/', '_wp_kses_decode_entities_chr_hexdec', $string); 
  4.  
  5. return $string;