bp_activity_filter_kses

Custom kses filtering for activity content.

Description

(string) bp_activity_filter_kses( (string) $content ); 

Returns (string)

$content Filtered activity content.

Parameters (1)

0. $content (string)
The activity content.

Usage

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

Defined (1)

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

/bp-activity/bp-activity-filters.php  
  1. function bp_activity_filter_kses( $content ) { 
  2. global $allowedtags; 
  3.  
  4. $activity_allowedtags = $allowedtags; 
  5. $activity_allowedtags['a']['class'] = array(); 
  6. $activity_allowedtags['a']['id'] = array(); 
  7. $activity_allowedtags['a']['rel'] = array(); 
  8. $activity_allowedtags['a']['title'] = array(); 
  9.  
  10. $activity_allowedtags['b'] = array(); 
  11. $activity_allowedtags['code'] = array(); 
  12. $activity_allowedtags['i'] = array(); 
  13.  
  14. $activity_allowedtags['img'] = array(); 
  15. $activity_allowedtags['img']['src'] = array(); 
  16. $activity_allowedtags['img']['alt'] = array(); 
  17. $activity_allowedtags['img']['width'] = array(); 
  18. $activity_allowedtags['img']['height'] = array(); 
  19. $activity_allowedtags['img']['class'] = array(); 
  20. $activity_allowedtags['img']['id'] = array(); 
  21. $activity_allowedtags['img']['title'] = array(); 
  22.  
  23. $activity_allowedtags['span'] = array(); 
  24. $activity_allowedtags['span']['class'] = array(); 
  25. $activity_allowedtags['span']['data-livestamp'] = array(); 
  26.  
  27.  
  28. /** 
  29. * Filters the allowed HTML tags for BuddyPress Activity content. 
  30. * @since 1.2.0 
  31. * @param array $value Array of allowed HTML tags and attributes. 
  32. */ 
  33. $activity_allowedtags = apply_filters( 'bp_activity_allowed_tags', $activity_allowedtags ); 
  34. return wp_kses( $content, $activity_allowedtags );