Changeset 3268
- Timestamp:
- 09/13/2010 11:09:20 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.2/bp-activity/bp-activity-filters.php
r3223 r3268 2 2 3 3 /* Apply WordPress defined filters */ 4 add_filter( 'bp_get_activity_action', 'bp_activity_filter_kses', 1 );5 add_filter( 'bp_get_activity_content_body', 'bp_activity_filter_kses', 1 );6 add_filter( 'bp_get_activity_content', 'bp_activity_filter_kses', 1 );7 add_filter( 'bp_get_activity_parent_content', 'bp_activity_filter_kses', 1 );8 add_filter( 'bp_get_activity_latest_update', 'bp_activity_filter_kses', 1 );4 add_filter( 'bp_get_activity_action', 'bp_activity_filter_kses', 1 ); 5 add_filter( 'bp_get_activity_content_body', 'bp_activity_filter_kses', 1 ); 6 add_filter( 'bp_get_activity_content', 'bp_activity_filter_kses', 1 ); 7 add_filter( 'bp_get_activity_parent_content', 'bp_activity_filter_kses', 1 ); 8 add_filter( 'bp_get_activity_latest_update', 'bp_activity_filter_kses', 1 ); 9 9 add_filter( 'bp_get_activity_latest_update_excerpt', 'bp_activity_filter_kses', 1 ); 10 10 add_filter( 'bp_get_activity_feed_item_description', 'bp_activity_filter_kses', 1 ); 11 add_filter( 'bp_activity_content_before_save', 'bp_activity_filter_kses', 1 );12 add_filter( 'bp_activity_action_before_save', 'bp_activity_filter_kses', 1 );11 add_filter( 'bp_activity_content_before_save', 'bp_activity_filter_kses', 1 ); 12 add_filter( 'bp_activity_action_before_save', 'bp_activity_filter_kses', 1 ); 13 13 14 add_filter( 'bp_get_activity_action', 'force_balance_tags' );15 add_filter( 'bp_get_activity_content_body', 'force_balance_tags' );16 add_filter( 'bp_get_activity_content', 'force_balance_tags' );17 add_filter( 'bp_get_activity_latest_update', 'force_balance_tags' );14 add_filter( 'bp_get_activity_action', 'force_balance_tags' ); 15 add_filter( 'bp_get_activity_content_body', 'force_balance_tags' ); 16 add_filter( 'bp_get_activity_content', 'force_balance_tags' ); 17 add_filter( 'bp_get_activity_latest_update', 'force_balance_tags' ); 18 18 add_filter( 'bp_get_activity_latest_update_excerpt', 'force_balance_tags' ); 19 19 add_filter( 'bp_get_activity_feed_item_description', 'force_balance_tags' ); 20 add_filter( 'bp_activity_content_before_save', 'force_balance_tags' ); 21 add_filter( 'bp_activity_action_before_save', 'force_balance_tags' ); 20 22 21 add_filter( 'bp_get_activity_action', 'wptexturize' );22 add_filter( 'bp_get_activity_content_body', 'wptexturize' );23 add_filter( 'bp_get_activity_content', 'wptexturize' );24 add_filter( 'bp_get_activity_parent_content', 'wptexturize' );25 add_filter( 'bp_get_activity_latest_update', 'wptexturize' );23 add_filter( 'bp_get_activity_action', 'wptexturize' ); 24 add_filter( 'bp_get_activity_content_body', 'wptexturize' ); 25 add_filter( 'bp_get_activity_content', 'wptexturize' ); 26 add_filter( 'bp_get_activity_parent_content', 'wptexturize' ); 27 add_filter( 'bp_get_activity_latest_update', 'wptexturize' ); 26 28 add_filter( 'bp_get_activity_latest_update_excerpt', 'wptexturize' ); 27 29 28 add_filter( 'bp_get_activity_action', 'convert_smilies' );29 add_filter( 'bp_get_activity_content_body', 'convert_smilies' );30 add_filter( 'bp_get_activity_content', 'convert_smilies' );31 add_filter( 'bp_get_activity_parent_content', 'convert_smilies' );32 add_filter( 'bp_get_activity_latest_update', 'convert_smilies' );30 add_filter( 'bp_get_activity_action', 'convert_smilies' ); 31 add_filter( 'bp_get_activity_content_body', 'convert_smilies' ); 32 add_filter( 'bp_get_activity_content', 'convert_smilies' ); 33 add_filter( 'bp_get_activity_parent_content', 'convert_smilies' ); 34 add_filter( 'bp_get_activity_latest_update', 'convert_smilies' ); 33 35 add_filter( 'bp_get_activity_latest_update_excerpt', 'convert_smilies' ); 34 36 35 add_filter( 'bp_get_activity_action', 'convert_chars' );36 add_filter( 'bp_get_activity_content_body', 'convert_chars' );37 add_filter( 'bp_get_activity_content', 'convert_chars' );38 add_filter( 'bp_get_activity_parent_content', 'convert_chars' );39 add_filter( 'bp_get_activity_latest_update', 'convert_chars' );37 add_filter( 'bp_get_activity_action', 'convert_chars' ); 38 add_filter( 'bp_get_activity_content_body', 'convert_chars' ); 39 add_filter( 'bp_get_activity_content', 'convert_chars' ); 40 add_filter( 'bp_get_activity_parent_content', 'convert_chars' ); 41 add_filter( 'bp_get_activity_latest_update', 'convert_chars' ); 40 42 add_filter( 'bp_get_activity_latest_update_excerpt', 'convert_chars' ); 41 43 42 add_filter( 'bp_get_activity_action', 'wpautop' );43 add_filter( 'bp_get_activity_content_body', 'wpautop' );44 add_filter( 'bp_get_activity_content', 'wpautop' );44 add_filter( 'bp_get_activity_action', 'wpautop' ); 45 add_filter( 'bp_get_activity_content_body', 'wpautop' ); 46 add_filter( 'bp_get_activity_content', 'wpautop' ); 45 47 add_filter( 'bp_get_activity_feed_item_description', 'wpautop' ); 46 48 47 add_filter( 'bp_get_activity_action', 'make_clickable' );48 add_filter( 'bp_get_activity_content_body', 'make_clickable' );49 add_filter( 'bp_get_activity_content', 'make_clickable' );50 add_filter( 'bp_get_activity_parent_content', 'make_clickable' );51 add_filter( 'bp_get_activity_latest_update', 'make_clickable' );49 add_filter( 'bp_get_activity_action', 'make_clickable' ); 50 add_filter( 'bp_get_activity_content_body', 'make_clickable' ); 51 add_filter( 'bp_get_activity_content', 'make_clickable' ); 52 add_filter( 'bp_get_activity_parent_content', 'make_clickable' ); 53 add_filter( 'bp_get_activity_latest_update', 'make_clickable' ); 52 54 add_filter( 'bp_get_activity_latest_update_excerpt', 'make_clickable' ); 53 55 add_filter( 'bp_get_activity_feed_item_description', 'make_clickable' ); 54 56 55 add_filter( 'bp_acomment_name', 'stripslashes_deep' );56 add_filter( 'bp_get_activity_action', 'stripslashes_deep' );57 add_filter( 'bp_get_activity_content', 'stripslashes_deep' );58 add_filter( 'bp_get_activity_content_body', 'stripslashes_deep' );59 add_filter( 'bp_get_activity_parent_content', 'stripslashes_deep' );60 add_filter( 'bp_get_activity_latest_update', 'stripslashes_deep' );57 add_filter( 'bp_acomment_name', 'stripslashes_deep' ); 58 add_filter( 'bp_get_activity_action', 'stripslashes_deep' ); 59 add_filter( 'bp_get_activity_content', 'stripslashes_deep' ); 60 add_filter( 'bp_get_activity_content_body', 'stripslashes_deep' ); 61 add_filter( 'bp_get_activity_parent_content', 'stripslashes_deep' ); 62 add_filter( 'bp_get_activity_latest_update', 'stripslashes_deep' ); 61 63 add_filter( 'bp_get_activity_latest_update_excerpt', 'stripslashes_deep' ); 62 64 add_filter( 'bp_get_activity_feed_item_description', 'stripslashes_deep' ); 63 65 64 add_filter( 'bp_get_activity_content', 'bp_activity_make_nofollow_filter' ); 65 add_filter( 'bp_get_activity_content_body', 'bp_activity_make_nofollow_filter' ); 66 add_filter( 'bp_get_activity_parent_content', 'bp_activity_make_nofollow_filter' ); 67 add_filter( 'bp_get_activity_latest_update', 'bp_activity_make_nofollow_filter' ); 66 /* Apply BuddyPress defined filters */ 67 add_filter( 'bp_get_activity_content', 'bp_activity_make_nofollow_filter' ); 68 add_filter( 'bp_get_activity_content_body', 'bp_activity_make_nofollow_filter' ); 69 add_filter( 'bp_get_activity_parent_content', 'bp_activity_make_nofollow_filter' ); 70 add_filter( 'bp_get_activity_latest_update', 'bp_activity_make_nofollow_filter' ); 68 71 add_filter( 'bp_get_activity_latest_update_excerpt', 'bp_activity_make_nofollow_filter' ); 69 72 add_filter( 'bp_get_activity_feed_item_description', 'bp_activity_make_nofollow_filter' ); … … 79 82 80 83 $activity_allowedtags = $allowedtags; 81 $activity_allowedtags['span'] = array();84 $activity_allowedtags['span'] = array(); 82 85 $activity_allowedtags['span']['class'] = array(); 83 $activity_allowedtags['div'] = array();84 $activity_allowedtags['div']['class'] = array();85 $activity_allowedtags['div']['id'] = array();86 $activity_allowedtags['a']['class'] = array();87 $activity_allowedtags['img'] = array();88 $activity_allowedtags['img']['src'] = array();89 $activity_allowedtags['img']['alt'] = array();90 $activity_allowedtags['img']['class'] = array();91 $activity_allowedtags['img']['width'] = array();86 $activity_allowedtags['div'] = array(); 87 $activity_allowedtags['div']['class'] = array(); 88 $activity_allowedtags['div']['id'] = array(); 89 $activity_allowedtags['a']['class'] = array(); 90 $activity_allowedtags['img'] = array(); 91 $activity_allowedtags['img']['src'] = array(); 92 $activity_allowedtags['img']['alt'] = array(); 93 $activity_allowedtags['img']['class'] = array(); 94 $activity_allowedtags['img']['width'] = array(); 92 95 $activity_allowedtags['img']['height'] = array(); 93 $activity_allowedtags['img']['class'] = array();94 $activity_allowedtags['img']['id'] = array();95 $activity_allowedtags['img']['title'] = array();96 $activity_allowedtags['code'] = array();96 $activity_allowedtags['img']['class'] = array(); 97 $activity_allowedtags['img']['id'] = array(); 98 $activity_allowedtags['img']['title'] = array(); 99 $activity_allowedtags['code'] = array(); 97 100 98 101 $activity_allowedtags = apply_filters( 'bp_activity_allowed_tags', $activity_allowedtags ); … … 106 109 preg_match_all( $pattern, $content, $usernames ); 107 110 108 / * Make sure there's only one instance of each username */111 // Make sure there's only one instance of each username 109 112 if ( !$usernames = array_unique( $usernames[1] ) ) 110 113 return $content; … … 114 117 continue; 115 118 116 / * Increase the number of new @ mentions for the user */119 // Increase the number of new @ mentions for the user 117 120 $new_mention_count = (int)get_user_meta( $user_id, 'bp_new_mention_count', true ); 118 121 update_user_meta( $user_id, 'bp_new_mention_count', $new_mention_count + 1 ); … … 123 126 return $content; 124 127 } 125 add_filter( 'bp_activity_new_update_content', 'bp_activity_at_name_filter' );128 add_filter( 'bp_activity_new_update_content', 'bp_activity_at_name_filter' ); 126 129 add_filter( 'groups_activity_new_update_content', 'bp_activity_at_name_filter' ); 127 add_filter( 'pre_comment_content', 'bp_activity_at_name_filter' );130 add_filter( 'pre_comment_content', 'bp_activity_at_name_filter' ); 128 131 add_filter( 'group_forum_topic_text_before_save', 'bp_activity_at_name_filter' ); 129 add_filter( 'group_forum_post_text_before_save', 'bp_activity_at_name_filter' );130 add_filter( 'bp_activity_comment_content', 'bp_activity_at_name_filter' );132 add_filter( 'group_forum_post_text_before_save', 'bp_activity_at_name_filter' ); 133 add_filter( 'bp_activity_comment_content', 'bp_activity_at_name_filter' ); 131 134 132 135 function bp_activity_make_nofollow_filter( $text ) {
Note: See TracChangeset
for help on using the changeset viewer.