wp_pre_kses_less_than_callback

Callback function used by preg_replace.

Description

(string) wp_pre_kses_less_than_callback( (array) $matches ); 

Returns (string)

The text returned after esc_html if needed.

Parameters (1)

0. $matches (array)
Populated by matches to preg_replace.

Usage

  1. if ( !function_exists( 'wp_pre_kses_less_than_callback' ) ) { 
  2. require_once ABSPATH . WPINC . '/formatting.php'; 
  3.  
  4. // Populated by matches to preg_replace. 
  5. $matches = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wp_pre_kses_less_than_callback($matches); 
  9.  

Defined (1)

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

/wp-includes/formatting.php  
  1. function wp_pre_kses_less_than_callback( $matches ) { 
  2. if ( false === strpos($matches[0], '>') ) 
  3. return esc_html($matches[0]); 
  4. return $matches[0];