bp_forums_filter_kses

Custom KSES filter for the Forums component.

Description

(string) bp_forums_filter_kses( (string) $content ); 

Returns (string)

Sanitized string.

Parameters (1)

0. $content (string)
Content to sanitize.

Usage

  1. if ( !function_exists( 'bp_forums_filter_kses' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bp-forums-filters.php'; 
  3.  
  4. // Content to sanitize. 
  5. $content = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_forums_filter_kses($content); 
  9.  

Defined (1)

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

/bp-forums/bp-forums-filters.php  
  1. function bp_forums_filter_kses( $content ) { 
  2. global $allowedtags; 
  3.  
  4. $forums_allowedtags = $allowedtags; 
  5. $forums_allowedtags['span'] = array(); 
  6. $forums_allowedtags['span']['class'] = array(); 
  7. $forums_allowedtags['div'] = array(); 
  8. $forums_allowedtags['div']['class'] = array(); 
  9. $forums_allowedtags['div']['id'] = array(); 
  10. $forums_allowedtags['a']['class'] = array(); 
  11. $forums_allowedtags['img'] = array(); 
  12. $forums_allowedtags['br'] = array(); 
  13. $forums_allowedtags['p'] = array(); 
  14. $forums_allowedtags['img']['src'] = array(); 
  15. $forums_allowedtags['img']['alt'] = array(); 
  16. $forums_allowedtags['img']['class'] = array(); 
  17. $forums_allowedtags['img']['width'] = array(); 
  18. $forums_allowedtags['img']['height'] = array(); 
  19. $forums_allowedtags['img']['class'] = array(); 
  20. $forums_allowedtags['img']['id'] = array(); 
  21. $forums_allowedtags['code'] = array(); 
  22. $forums_allowedtags['blockquote'] = array(); 
  23.  
  24. /** 
  25. * Filters the allowed HTML tags for forum posts. 
  26. * @since 1.2.0 
  27. * @param array $forums_allowedtags Array of allowed HTML tags. 
  28. */ 
  29. $forums_allowedtags = apply_filters( 'bp_forums_allowed_tags', $forums_allowedtags ); 
  30. return wp_kses( $content, $forums_allowedtags );