Skip to:
Content

BuddyPress.org

Changeset 5901


Ignore:
Timestamp:
03/11/2012 03:31:35 PM (13 years ago)
Author:
boonebgorges
Message:

Introduces bp_activity_latest_update_content filter, to allow the filtering of update content before it is saved to a user's latest_update usermeta.
Moves the hardcoded wp_filter_kses() filter on latest_update content to an unhookable add_filter() call.
Fixes #4058. Props wpdennis, Mamaduka

Location:
trunk/bp-activity
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-filters.php

    r5729 r5901  
    2323add_filter( 'bp_activity_content_before_save',       'bp_activity_filter_kses', 1 );
    2424add_filter( 'bp_activity_action_before_save',        'bp_activity_filter_kses', 1 );
     25add_filter( 'bp_activity_latest_update_content',     'wp_filter_kses', 1 );
    2526
    2627add_filter( 'bp_get_activity_action',                'force_balance_tags' );
  • trunk/bp-activity/bp-activity-functions.php

    r5729 r5901  
    986986    ) );
    987987
     988    $activity_content = apply_filters( 'bp_activity_latest_update_content', $content );
     989
    988990    // Add this update to the "latest update" usermeta so it can be fetched anywhere.
    989     bp_update_user_meta( bp_loggedin_user_id(), 'bp_latest_update', array( 'id' => $activity_id, 'content' => wp_filter_kses( $content ) ) );
     991    bp_update_user_meta( bp_loggedin_user_id(), 'bp_latest_update', array( 'id' => $activity_id, 'content' => $content ) );
    990992
    991993    do_action( 'bp_activity_posted_update', $content, $user_id, $activity_id );
Note: See TracChangeset for help on using the changeset viewer.