wp_kses_html_error

Handles parsing errors in wp_kses_hair().

Description

(string) wp_kses_html_error( (string) $string ); 

The general plan is to remove everything to and including some whitespace, but it deals with quotes and apostrophes as well.

Returns (string)

Parameters (1)

0. $string (string)
The string.

Usage

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

Defined (1)

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

/wp-includes/kses.php  
  1. function wp_kses_html_error($string) { 
  2. return preg_replace('/^("[^"]*("|$)|\'[^\']*(\'|$)|\S)*\s*/', '', $string);