bbp_remove_group_id_from_all_forums
Remove a group from aall forums.
Description
bbp_remove_group_id_from_all_forums( (int) $group_id = 0 );
Parameters (1)
- 0. $group_id — Optional. (int)
- The group id.
Usage
if ( !function_exists( 'bbp_remove_group_id_from_all_forums' ) ) { require_once ABSPATH . PLUGINDIR . 'bbpress/includes/extend/buddypress/functions.php'; } // The group id. $group_id = -1; // NOTICE! Understand what this does before running. $result = bbp_remove_group_id_from_all_forums($group_id);
Defined (1)
The function is defined in the following location(s).
- /includes/extend/buddypress/functions.php
- 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 );
- }
- }