Skip to:
Content

BuddyPress.org

Ticket #2773: before-delete.patch

File before-delete.patch, 2.3 KB (added by kunalb, 16 years ago)
  • bp-groups.php

     
    451451                                /* Check the nonce */
    452452                                check_admin_referer( 'bp_forums_delete_topic' );
    453453
     454                                do_action( 'groups_before_delete_forum_topic', $topic_id );
     455
    454456                                if ( !groups_delete_group_forum_topic( $topic_id ) )
    455457                                        bp_core_add_message( __( 'There was an error deleting the topic', 'buddypress'), 'error' );
    456458                                else
     
    497499                                /* Check the nonce */
    498500                                check_admin_referer( 'bp_forums_delete_post' );
    499501
     502                                do_action( 'groups_before_delete_forum_post', $post_id );
     503
    500504                                if ( !groups_delete_group_forum_post( $bp->action_variables[4], $topic_id ) )
    501505                                        bp_core_add_message( __( 'There was an error deleting that post', 'buddypress'), 'error' );
    502506                                else
     
    956960                        if ( !check_admin_referer( 'groups_delete_group' ) )
    957961                                return false;
    958962
     963                        do_action( 'groups_before_group_deleted', $bp->groups->current_group->id );
     964
    959965                        // Group admin has deleted the group, now do it.
    960966                        if ( !groups_delete_group( $bp->groups->current_group->id ) ) {
    961967                                bp_core_add_message( __( 'There was an error deleting the group, please try again.', 'buddypress' ), 'error' );
     
    16381644        if ( !$bp->is_item_admin )
    16391645                return false;
    16401646
     1647        do_action( 'groups_before_delete_group', $group_id);
     1648
    16411649        // Get the group object
    16421650        $group = new BP_Groups_Group( $group_id );
    16431651        if ( !$group->delete() )
     
    21712179        global $bp;
    21722180
    21732181        if ( bp_forums_delete_topic( array( 'topic_id' => $topic_id ) ) ) {
     2182                do_action( 'groups_before_delete_group_forum_topic', $topic_id );
     2183               
    21742184                /* Delete the activity stream item */
    21752185                if ( function_exists( 'bp_activity_delete' ) ) {
    21762186                        bp_activity_delete( array( 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $topic_id, 'component' => $bp->groups->id, 'type' => 'new_forum_topic' ) );
     
    21882198        global $bp;
    21892199
    21902200        if ( bp_forums_delete_post( array( 'post_id' => $post_id ) ) ) {
     2201                do_action( 'groups_before_delete_group_forum_post', $post_id, $topic_id );
     2202
    21912203                /* Delete the activity stream item */
    21922204                if ( function_exists( 'bp_activity_delete' ) ) {
    21932205                        bp_activity_delete( array( 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $post_id, 'component' => $bp->groups->id, 'type' => 'new_forum_post' ) );