Skip to content

Commit

Permalink
Follow: Delete follow relationship when new paper activity item is de…
Browse files Browse the repository at this point in the history
…leted.

See #7.
  • Loading branch information
r-a-y committed Oct 29, 2015
1 parent 74a51c5 commit 1659e40
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions includes/hooks-buddypress-follow.php
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,14 @@ function cacsp_follow_clear_cache_on_activity_delete( $activities ) {

// delete queried papers that user was following
wp_cache_delete( $activity->follower_id, 'bp_follow_user_cacsp_paper_following_query' );

// Delete the follow entry
// @todo Need a mass bulk-delete method
bp_follow_stop_following( array(
'leader_id' => $activity->leader_id,
'follower_id' => $activity->follower_id,
'follow_type' => 'cacsp_paper'
) );
}
}

Expand Down

0 comments on commit 1659e40

Please sign in to comment.