* @param int $post_id The id of the post you want to delete
* @param int $topic_id Optional. The topic to which the post belongs. This value isn't used in the
* function but is passed along to do_action() hooks.
* @return bool True on success.
*/
function groups_delete_group_forum_post( $post_id, $topic_id = false ) {
global $bp;
if ( bp_forums_delete_post( array( 'post_id' => $post_id ) ) ) {
do_action( 'groups_before_delete_group_forum_post', $post_id, $topic_id );
// Delete the activity stream item
if ( bp_is_active( 'activity' ) )
bp_activity_delete( array( 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $post_id, 'component' => $bp->groups->id, 'type' => 'new_forum_post' ) );
do_action( 'groups_delete_group_forum_post', $post_id, $topic_id );
return true;
}