wp_kses_hook

You add any kses hooks here.

Description

(string) wp_kses_hook( (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 receive a string.

Returns (string)

Filtered content through {@see '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

  1. if ( !function_exists( 'wp_kses_hook' ) ) { 
  2. require_once ABSPATH . WPINC . '/kses.php'; 
  3.  
  4. // Content to filter through kses 
  5. $string = ''; 
  6.  
  7. // List of allowed HTML elements 
  8. $allowed_html = array(); 
  9.  
  10. // Allowed protocol in links 
  11. $allowed_protocols = array(); 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = wp_kses_hook($string, $allowed_html, $allowed_protocols); 
  15.  

Defined (1)

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

/wp-includes/kses.php  
  1. function wp_kses_hook( $string, $allowed_html, $allowed_protocols ) { 
  2. /** 
  3. * Filters content to be run through kses. 
  4. * @since 2.3.0 
  5. * @param string $string Content to run through kses. 
  6. * @param array $allowed_html Allowed HTML elements. 
  7. * @param array $allowed_protocols Allowed protocol in links. 
  8. */ 
  9. return apply_filters( 'pre_kses', $string, $allowed_html, $allowed_protocols );