esc_html

Filters a string cleaned and escaped for output in HTML.

Description

apply_filters( 'esc_html', (unknown) $safe_text, (unknown) $text ); 

Parameters (2)

0. $safe_text (unknown)
The safe text.
1. $text (unknown)
The text.

Usage

To run the hook, copy the example below.
  1. $safe_text = apply_filters( 'esc_html', $safe_text, $text ); 
  2.  
  3. if ( !empty( $safe_text ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the esc_html callback 
  2. function filter_esc_html( $safe_text, $text ) { 
  3. // make filter magic happen here... 
  4. return $safe_text
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'esc_html', 'filter_esc_html', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'esc_html', 'filter_esc_html', 10, 2 ); 

Defined (1)

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

/bp-forums/bbpress/bb-includes/backpress/functions.formatting.php  
  1. return apply_filters( 'esc_html', $safe_text, $text );