Changeset 3230 for branches/1.2/bp-groups.php
- Timestamp:
- 09/02/2010 06:32:45 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.2/bp-groups.php
r3229 r3230 1621 1621 } 1622 1622 1623 /** 1624 * Delete a group and all of its associated meta 1625 * 1626 * @global object $bp BuddyPress global settings 1627 * @param int $group_id 1628 * @since 1.0 1629 */ 1623 1630 function groups_delete_group( $group_id ) { 1624 1631 global $bp; … … 1630 1637 // Get the group object 1631 1638 $group = new BP_Groups_Group( $group_id ); 1632 1633 1639 if ( !$group->delete() ) 1634 1640 return false; 1635 1641 1636 / * Delete all group activity from activity streams */1637 if ( function_exists( 'bp_activity_delete_by_item_id' ) ) {1642 // Delete all group activity from activity streams 1643 if ( bp_is_active( 'activity' ) ) 1638 1644 bp_activity_delete_by_item_id( array( 'item_id' => $group_id, 'component' => $bp->groups->id ) ); 1639 }1640 1645 1641 1646 // Remove all outstanding invites for this group … … 1645 1650 bp_core_delete_all_notifications_by_type( $group_id, $bp->groups->slug ); 1646 1651 1647 do_action( 'groups_delete_group', $group_id ); 1652 // Remove forum if component is active and current group has one 1653 if ( function_exists( 'bp_forums_setup' ) && $group->enable_forum ) { 1654 do_action( 'bbpress_init' ); 1655 bb_delete_forum( groups_get_groupmeta( $group_id, 'forum_id' ) ); 1656 } 1657 1658 do_action( 'groups_delete_group', $group_id); 1648 1659 1649 1660 return true;
Note: See TracChangeset
for help on using the changeset viewer.