/** * Removing a group forum or category (including root for group) * * @since bbPress (r3653) * @param type $forum_args * @uses bbp_get_forum_id() * @uses bp_get_current_group_id() * @uses bbp_add_forum_id_to_group() * @uses bbp_add_group_id_to_forum() * @return if no forum_id is available */ public function remove_forum($forum_args = array()) { // Bail if no forum_id was passed if (empty($forum_args['forum_id'])) { return; } // Validate forum_id $forum_id = bbp_get_forum_id($forum_args['forum_id']); $group_id = !empty($forum_args['group_id']) ? $forum_args['group_id'] : bp_get_current_group_id(); bbp_remove_forum_id_from_group($group_id, $forum_id); bbp_remove_group_id_from_forum($forum_id, $group_id); }
/** * Remove a group from aall forums * * @param type $group_id * @since bbPress (r3653) */ function bbp_remove_group_id_from_all_forums($group_id = 0) { // Use current group if none is set if (empty($group_id)) { $group_id = bp_get_current_group_id(); } // Get current group IDs $forum_ids = bbp_get_group_forum_ids($group_id); // Loop through forums and remove this group from each one foreach ((array) $forum_ids as $forum_id) { bbp_remove_group_id_from_forum($group_id, $forum_id); } }