pre_kses

You add any kses hooks here.

Description

(string) apply_filters( 'pre_kses', (string) $string, (array) $allowed_html, (array) $allowed_protocols ); 

There is currently only one kses WordPress hook and it is called here. All parameters are passed to the hooks and expected to recieve a string.

Returns (string)

Filtered content through 'pre_kses' hook

Parameters (3)

0. $string (string)
Content to filter through kses
1. $allowed_html (array)
List of allowed HTML elements
2. $allowed_protocols (array)
Allowed protocol in links

Usage

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

Defined (1)

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

/bp-forums/bbpress/bb-includes/backpress/functions.kses.php  
  1. $string = apply_filters('pre_kses', $string, $allowed_html, $allowed_protocols);