Skip to:
Content

BuddyPress.org

Changeset 3772


Ignore:
Timestamp:
01/20/2011 06:25:30 PM (14 years ago)
Author:
djpaul
Message:

Add before delete hooks to Friends and Activity components (see #2773). Props kunalb

Location:
trunk
Files:
4 edited

Legend:

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

    r3751 r3772  
    8787
    8888    // Call the action before the delete so plugins can still fetch information about it
    89     do_action( 'bp_activity_action_delete_activity', $activity_id, $activity->user_id );
     89    do_action( 'bp_activity_before_action_delete_activity', $activity_id, $activity->user_id );
    9090
    9191    // Delete the activity item and provide user feedback
     
    9494    else
    9595        bp_core_add_message( __( 'There was an error when deleting that activity', 'buddypress' ), 'error' );
     96
     97    do_action( 'bp_activity_action_delete_activity', $activity_id, $activity->user_id );
    9698
    9799    // Redirect
  • trunk/bp-activity/bp-activity-functions.php

    r3765 r3772  
    771771        $user_id = $args['user_id'];
    772772
     773    do_action( 'bp_before_activity_delete', $args );
     774
    773775    $latest_update = get_user_meta( $user_id, 'bp_latest_update', true );
    774776    if ( !empty( $latest_update ) ) {
  • trunk/bp-friends/bp-friends-loader.php

    r3757 r3772  
    380380    $friendship    = new BP_Friends_Friendship( $friendship_id );
    381381
     382    do_action( 'friends_before_friendship_delete', $friendship_id, $initiator_userid, $friend_userid );
     383
    382384    // Remove the activity stream item for the user who canceled the friendship
    383385    friends_delete_activity( array( 'item_id' => $friendship_id, 'type' => 'friendship_accepted', 'user_id' => $bp->displayed_user->id ) );
     
    590592    global $bp;
    591593
     594    do_action( 'friends_before_remove_data', $user_id );
     595
    592596    BP_Friends_Friendship::delete_all_for_user($user_id);
    593597
  • trunk/bp-themes/bp-default/_inc/ajax.php

    r3771 r3772  
    245245
    246246    // Call the action before the delete so plugins can still fetch information about it
    247     do_action( 'bp_activity_action_delete_activity', $_POST['id'], $activity->user_id );
     247    do_action( 'bp_activity_before_action_delete_activity', $_POST['id'], $activity->user_id );
    248248
    249249    if ( !bp_activity_delete( array( 'id' => $_POST['id'], 'user_id' => $activity->user_id ) ) ) {
     
    252252    }
    253253
     254    do_action( 'bp_activity_action_delete_activity', $_POST['id'], $activity->user_id );
     255
    254256    return true;
    255257}
     
    278280
    279281    /* Call the action before the delete so plugins can still fetch information about it */
    280     do_action( 'bp_activity_action_delete_activity', $_POST['id'], $comment->user_id );
     282    do_action( 'bp_activity_before_action_delete_activity', $_POST['id'], $comment->user_id );
    281283
    282284    if ( !bp_activity_delete_comment( $comment->item_id, $comment->id ) ) {
     
    284286        return false;
    285287    }
     288
     289    do_action( 'bp_activity_action_delete_activity', $_POST['id'], $comment->user_id );
    286290
    287291    return true;
Note: See TracChangeset for help on using the changeset viewer.