Skip to:
Content

BuddyPress.org

Changeset 3268


Ignore:
Timestamp:
09/13/2010 11:09:20 PM (14 years ago)
Author:
johnjamesjacoby
Message:

Fixes #2632(branch) props Paul Gibbs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/bp-activity/bp-activity-filters.php

    r3223 r3268  
    22
    33/* 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 );
     4add_filter( 'bp_get_activity_action',                'bp_activity_filter_kses', 1 );
     5add_filter( 'bp_get_activity_content_body',          'bp_activity_filter_kses', 1 );
     6add_filter( 'bp_get_activity_content',               'bp_activity_filter_kses', 1 );
     7add_filter( 'bp_get_activity_parent_content',        'bp_activity_filter_kses', 1 );
     8add_filter( 'bp_get_activity_latest_update',         'bp_activity_filter_kses', 1 );
    99add_filter( 'bp_get_activity_latest_update_excerpt', 'bp_activity_filter_kses', 1 );
    1010add_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 );
     11add_filter( 'bp_activity_content_before_save',       'bp_activity_filter_kses', 1 );
     12add_filter( 'bp_activity_action_before_save',        'bp_activity_filter_kses', 1 );
    1313
    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' );
     14add_filter( 'bp_get_activity_action',                'force_balance_tags' );
     15add_filter( 'bp_get_activity_content_body',          'force_balance_tags' );
     16add_filter( 'bp_get_activity_content',               'force_balance_tags' );
     17add_filter( 'bp_get_activity_latest_update',         'force_balance_tags' );
    1818add_filter( 'bp_get_activity_latest_update_excerpt', 'force_balance_tags' );
    1919add_filter( 'bp_get_activity_feed_item_description', 'force_balance_tags' );
     20add_filter( 'bp_activity_content_before_save',       'force_balance_tags' );
     21add_filter( 'bp_activity_action_before_save',        'force_balance_tags' );
    2022
    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' );
     23add_filter( 'bp_get_activity_action',                'wptexturize' );
     24add_filter( 'bp_get_activity_content_body',          'wptexturize' );
     25add_filter( 'bp_get_activity_content',               'wptexturize' );
     26add_filter( 'bp_get_activity_parent_content',        'wptexturize' );
     27add_filter( 'bp_get_activity_latest_update',         'wptexturize' );
    2628add_filter( 'bp_get_activity_latest_update_excerpt', 'wptexturize' );
    2729
    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' );
     30add_filter( 'bp_get_activity_action',                'convert_smilies' );
     31add_filter( 'bp_get_activity_content_body',          'convert_smilies' );
     32add_filter( 'bp_get_activity_content',               'convert_smilies' );
     33add_filter( 'bp_get_activity_parent_content',        'convert_smilies' );
     34add_filter( 'bp_get_activity_latest_update',         'convert_smilies' );
    3335add_filter( 'bp_get_activity_latest_update_excerpt', 'convert_smilies' );
    3436
    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' );
     37add_filter( 'bp_get_activity_action',                'convert_chars' );
     38add_filter( 'bp_get_activity_content_body',          'convert_chars' );
     39add_filter( 'bp_get_activity_content',               'convert_chars' );
     40add_filter( 'bp_get_activity_parent_content',        'convert_chars' );
     41add_filter( 'bp_get_activity_latest_update',         'convert_chars' );
    4042add_filter( 'bp_get_activity_latest_update_excerpt', 'convert_chars' );
    4143
    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' );
     44add_filter( 'bp_get_activity_action',                'wpautop' );
     45add_filter( 'bp_get_activity_content_body',          'wpautop' );
     46add_filter( 'bp_get_activity_content',               'wpautop' );
    4547add_filter( 'bp_get_activity_feed_item_description', 'wpautop' );
    4648
    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' );
     49add_filter( 'bp_get_activity_action',                'make_clickable' );
     50add_filter( 'bp_get_activity_content_body',          'make_clickable' );
     51add_filter( 'bp_get_activity_content',               'make_clickable' );
     52add_filter( 'bp_get_activity_parent_content',        'make_clickable' );
     53add_filter( 'bp_get_activity_latest_update',         'make_clickable' );
    5254add_filter( 'bp_get_activity_latest_update_excerpt', 'make_clickable' );
    5355add_filter( 'bp_get_activity_feed_item_description', 'make_clickable' );
    5456
    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' );
     57add_filter( 'bp_acomment_name',                      'stripslashes_deep' );
     58add_filter( 'bp_get_activity_action',                'stripslashes_deep' );
     59add_filter( 'bp_get_activity_content',               'stripslashes_deep' );
     60add_filter( 'bp_get_activity_content_body',          'stripslashes_deep' );
     61add_filter( 'bp_get_activity_parent_content',        'stripslashes_deep' );
     62add_filter( 'bp_get_activity_latest_update',         'stripslashes_deep' );
    6163add_filter( 'bp_get_activity_latest_update_excerpt', 'stripslashes_deep' );
    6264add_filter( 'bp_get_activity_feed_item_description', 'stripslashes_deep' );
    6365
    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 */
     67add_filter( 'bp_get_activity_content',               'bp_activity_make_nofollow_filter' );
     68add_filter( 'bp_get_activity_content_body',          'bp_activity_make_nofollow_filter' );
     69add_filter( 'bp_get_activity_parent_content',        'bp_activity_make_nofollow_filter' );
     70add_filter( 'bp_get_activity_latest_update',         'bp_activity_make_nofollow_filter' );
    6871add_filter( 'bp_get_activity_latest_update_excerpt', 'bp_activity_make_nofollow_filter' );
    6972add_filter( 'bp_get_activity_feed_item_description', 'bp_activity_make_nofollow_filter' );
     
    7982
    8083    $activity_allowedtags = $allowedtags;
    81     $activity_allowedtags['span'] = array();
     84    $activity_allowedtags['span']          = array();
    8285    $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();
    9295    $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();
    97100
    98101    $activity_allowedtags = apply_filters( 'bp_activity_allowed_tags', $activity_allowedtags );
     
    106109    preg_match_all( $pattern, $content, $usernames );
    107110
    108     /* Make sure there's only one instance of each username */
     111    // Make sure there's only one instance of each username
    109112    if ( !$usernames = array_unique( $usernames[1] ) )
    110113        return $content;
     
    114117            continue;
    115118
    116         /* Increase the number of new @ mentions for the user */
     119        // Increase the number of new @ mentions for the user
    117120        $new_mention_count = (int)get_user_meta( $user_id, 'bp_new_mention_count', true );
    118121        update_user_meta( $user_id, 'bp_new_mention_count', $new_mention_count + 1 );
     
    123126    return $content;
    124127}
    125 add_filter( 'bp_activity_new_update_content', 'bp_activity_at_name_filter' );
     128add_filter( 'bp_activity_new_update_content',     'bp_activity_at_name_filter' );
    126129add_filter( 'groups_activity_new_update_content', 'bp_activity_at_name_filter' );
    127 add_filter( 'pre_comment_content', 'bp_activity_at_name_filter' );
     130add_filter( 'pre_comment_content',                'bp_activity_at_name_filter' );
    128131add_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' );
     132add_filter( 'group_forum_post_text_before_save',  'bp_activity_at_name_filter' );
     133add_filter( 'bp_activity_comment_content',        'bp_activity_at_name_filter' );
    131134
    132135function bp_activity_make_nofollow_filter( $text ) {
Note: See TracChangeset for help on using the changeset viewer.