bbp_remove_group_id_from_forum( $forum_id, type $group_id )
Remove a group from a forum
Description
Parameters
- $group_id
-
(Required)
Source
File: bp-forums/functions.php
function bbp_remove_group_id_from_forum( $forum_id = 0, $group_id = 0 ) { // Validate forum_id $forum_id = bbp_get_forum_id( $forum_id ); // Use current group if none is set if ( empty( $group_id ) ) $group_id = bp_get_current_group_id(); // Get current group IDs $group_ids = bbp_get_forum_group_ids( $forum_id ); // Maybe update the groups forums if ( in_array( $group_id, $group_ids ) ) { $group_ids = array_diff( array_values( $group_ids ), (array) $group_id ); return bbp_update_forum_group_ids( $forum_id, $group_ids ); } }
Changelog
Version | Description |
---|---|
bbPress (r3653) | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.