Skip to:
Content

BuddyPress.org

Ticket #7920: 7920.01.patch

File 7920.01.patch, 1.3 KB (added by r-a-y, 4 years ago)
  • src/bp-friends/bp-friends-activity.php

     
    409409        ) );
    410410}
    411411add_action( 'friends_remove_data', 'bp_friends_delete_activity_on_user_delete' );
     412
     413/**
     414 * Remove friendship activity item when a friendship is deleted.
     415 *
     416 * @since 3.2.0
     417 *
     418 * @param int $friendship_id ID of the friendship.
     419 */
     420function bp_friends_delete_activity_on_friendship_delete( $friendship_id ) {
     421        friends_delete_activity( array( 'item_id' => $friendship_id, 'type' => 'friendship_created', 'user_id' => 0 ) );
     422}
     423add_action( 'friends_friendship_deleted', 'bp_friends_delete_activity_on_friendship_delete' );
  • src/bp-friends/bp-friends-functions.php

     
    115115         */
    116116        do_action( 'friends_before_friendship_delete', $friendship_id, $initiator_userid, $friend_userid );
    117117
    118         // Remove the activity stream items about the friendship id.
    119         friends_delete_activity( array( 'item_id' => $friendship_id, 'type' => 'friendship_created', 'user_id' => 0 ) );
    120 
    121118        /**
    122119         * Fires before the friendship connection is removed.
    123120         *