Skip to:
Content

BuddyPress.org

Changeset 7108


Ignore:
Timestamp:
05/27/2013 01:02:30 PM (12 years ago)
Author:
boonebgorges
Message:

Introduce friends_friendship_post_delete hook

The existing hook friends_friendship_deleted hook actually fires before the
friendship count is deleted in the database. This causes problems for plugins
that want to access the updated user friend counts, and other info that is
changed at the time of delete.

Fixes #5019

Props mukkundthanki

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-friends/bp-friends-functions.php

    r6342 r7108  
    6666    friends_delete_activity( array( 'item_id' => $friendship_id, 'type' => 'friendship_accepted', 'user_id' => bp_displayed_user_id() ) );
    6767
     68    // This hook is misleadingly named - the friendship is not yet deleted.
     69    // This is your last chance to do something while the friendship exists
    6870    do_action( 'friends_friendship_deleted', $friendship_id, $initiator_userid, $friend_userid );
    6971
     
    7375        return true;
    7476    }
     77
     78    do_action( 'friends_friendship_post_delete', $initiator_userid, $friend_userid );
    7579
    7680    return false;
Note: See TracChangeset for help on using the changeset viewer.