Ticket #2773: before-delete.patch
| File before-delete.patch, 2.3 KB (added by , 16 years ago) |
|---|
-
bp-groups.php
451 451 /* Check the nonce */ 452 452 check_admin_referer( 'bp_forums_delete_topic' ); 453 453 454 do_action( 'groups_before_delete_forum_topic', $topic_id ); 455 454 456 if ( !groups_delete_group_forum_topic( $topic_id ) ) 455 457 bp_core_add_message( __( 'There was an error deleting the topic', 'buddypress'), 'error' ); 456 458 else … … 497 499 /* Check the nonce */ 498 500 check_admin_referer( 'bp_forums_delete_post' ); 499 501 502 do_action( 'groups_before_delete_forum_post', $post_id ); 503 500 504 if ( !groups_delete_group_forum_post( $bp->action_variables[4], $topic_id ) ) 501 505 bp_core_add_message( __( 'There was an error deleting that post', 'buddypress'), 'error' ); 502 506 else … … 956 960 if ( !check_admin_referer( 'groups_delete_group' ) ) 957 961 return false; 958 962 963 do_action( 'groups_before_group_deleted', $bp->groups->current_group->id ); 964 959 965 // Group admin has deleted the group, now do it. 960 966 if ( !groups_delete_group( $bp->groups->current_group->id ) ) { 961 967 bp_core_add_message( __( 'There was an error deleting the group, please try again.', 'buddypress' ), 'error' ); … … 1638 1644 if ( !$bp->is_item_admin ) 1639 1645 return false; 1640 1646 1647 do_action( 'groups_before_delete_group', $group_id); 1648 1641 1649 // Get the group object 1642 1650 $group = new BP_Groups_Group( $group_id ); 1643 1651 if ( !$group->delete() ) … … 2171 2179 global $bp; 2172 2180 2173 2181 if ( bp_forums_delete_topic( array( 'topic_id' => $topic_id ) ) ) { 2182 do_action( 'groups_before_delete_group_forum_topic', $topic_id ); 2183 2174 2184 /* Delete the activity stream item */ 2175 2185 if ( function_exists( 'bp_activity_delete' ) ) { 2176 2186 bp_activity_delete( array( 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $topic_id, 'component' => $bp->groups->id, 'type' => 'new_forum_topic' ) ); … … 2188 2198 global $bp; 2189 2199 2190 2200 if ( bp_forums_delete_post( array( 'post_id' => $post_id ) ) ) { 2201 do_action( 'groups_before_delete_group_forum_post', $post_id, $topic_id ); 2202 2191 2203 /* Delete the activity stream item */ 2192 2204 if ( function_exists( 'bp_activity_delete' ) ) { 2193 2205 bp_activity_delete( array( 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $post_id, 'component' => $bp->groups->id, 'type' => 'new_forum_post' ) );
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)