Changeset 1925
- Timestamp:
- 09/23/2009 12:33:11 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-filters.php
r1905 r1925 2 2 3 3 /* Apply WordPress defined filters */ 4 add_filter( 'bp_get_activity_content', ' wp_filter_kses', 1 );4 add_filter( 'bp_get_activity_content', 'bp_activity_filter_kses', 1 ); 5 5 add_filter( 'bp_get_activity_content', 'force_balance_tags' ); 6 6 add_filter( 'bp_get_activity_content', 'wptexturize' ); … … 11 11 add_filter( 'bp_get_activity_content', 'stripslashes_deep' ); 12 12 13 function bp_activity_add_allowed_tags( $allowedtags ) { 14 $allowedtags['span'] = array(); 15 $allowedtags['span']['class'] = array(); 16 $allowedtags['a']['class'] = array(); 17 $allowedtags['img'] = array(); 18 $allowedtags['img']['src'] = array(); 19 $allowedtags['img']['alt'] = array(); 20 $allowedtags['img']['class'] = array(); 21 $allowedtags['img']['id'] = array(); 13 function bp_activity_filter_kses( $content ) { 14 global $allowedtags; 22 15 23 return $allowedtags; 16 $activity_allowedtags = $allowedtags; 17 $activity_allowedtags['span'] = array(); 18 $activity_allowedtags['span']['class'] = array(); 19 $activity_allowedtags['a']['class'] = array(); 20 $activity_allowedtags['img'] = array(); 21 $activity_allowedtags['img']['src'] = array(); 22 $activity_allowedtags['img']['alt'] = array(); 23 $activity_allowedtags['img']['class'] = array(); 24 $activity_allowedtags['img']['width'] = array(); 25 $activity_allowedtags['img']['height'] = array(); 26 $activity_allowedtags['img']['class'] = array(); 27 $activity_allowedtags['img']['id'] = array(); 28 29 return wp_kses( $content, $activity_allowedtags ); 24 30 } 25 add_filter( 'edit_allowedtags', 'bp_activity_add_allowed_tags', 1 ); 31 26 32 27 33 ?> -
trunk/bp-core/bp-core-templatetags.php
r1906 r1925 713 713 function bp_create_excerpt( $text, $excerpt_length = 55, $filter_shortcodes = true ) { // Fakes an excerpt if needed 714 714 $text = str_replace(']]>', ']]>', $text); 715 $text = strip_tags($text); 716 715 717 716 if ( $filter_shortcodes ) 718 717 $text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text ); -
trunk/bp-wire/bp-wire-filters.php
r1905 r1925 2 2 3 3 /* Apply WordPress defined filters */ 4 add_filter( 'bp_wire_post_content_before_save', ' wp_filter_kses', 1 );5 add_filter( 'bp_get_wire_post_content', ' wp_filter_kses', 1 );4 add_filter( 'bp_wire_post_content_before_save', 'bp_wire_filter_kses', 1 ); 5 add_filter( 'bp_get_wire_post_content', 'bp_wire_filter_kses', 1 ); 6 6 7 7 add_filter( 'bp_get_wire_post_content', 'wptexturize' ); … … 13 13 14 14 add_filter( 'bp_wire_post_content_before_save', 'force_balance_tags' ); 15 add_filter( 'bp_get_wire_post_content', 'force_balance_tags' ); 15 16 16 function bp_wire_add_allowed_tags( $allowedtags ) { 17 $allowedtags['strong'] = array(); 18 $allowedtags['em'] = array(); 19 $allowedtags['img'] = array(); 20 return $allowedtags; 17 function bp_wire_filter_kses( $content ) { 18 global $allowedtags; 19 20 $wire_allowedtags = $allowedtags; 21 $wire_allowedtags['img'] = array(); 22 $wire_allowedtags['img']['src'] = array(); 23 $wire_allowedtags['img']['alt'] = array(); 24 $wire_allowedtags['img']['class'] = array(); 25 $wire_allowedtags['img']['width'] = array(); 26 $wire_allowedtags['img']['height'] = array(); 27 28 return wp_kses( $content, $wire_allowedtags ); 21 29 } 22 add_filter( 'edit_allowedtags', 'bp_wire_add_allowed_tags', 1 );23 24 30 25 31 ?>
Note: See TracChangeset
for help on using the changeset viewer.