Changeset 4562
- Timestamp:
- 06/24/2011 08:17:29 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.2/bp-groups.php
r4066 r4562 2171 2171 global $bp; 2172 2172 2173 // Before deleting the thread, get the post ids so that their activity items can be deleted 2174 $posts = bp_forums_get_topic_posts( array( 'topic_id' => $topic_id, 'per_page' => -1 ) ); 2175 2173 2176 if ( bp_forums_delete_topic( array( 'topic_id' => $topic_id ) ) ) { 2174 /* Delete the activity stream item */ 2175 if ( function_exists( 'bp_activity_delete' ) ) { 2177 do_action( 'groups_before_delete_group_forum_topic', $topic_id ); 2178 2179 // Delete the activity stream items 2180 if ( bp_is_active( 'activity' ) ) { 2181 // The activity item for the initial topic 2176 2182 bp_activity_delete( array( 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $topic_id, 'component' => $bp->groups->id, 'type' => 'new_forum_topic' ) ); 2183 2184 // The activity item for each post 2185 foreach ( (array)$posts as $post ) { 2186 bp_activity_delete( array( 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $post->post_id, 'component' => $bp->groups->id, 'type' => 'new_forum_post' ) ); 2187 } 2177 2188 } 2178 2189
Note: See TracChangeset
for help on using the changeset viewer.