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

  1. if ( !function_exists( 'bbp_remove_group_id_from_all_forums' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/extend/buddypress/functions.php'; 
  3.  
  4. // The group id. 
  5. $group_id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bbp_remove_group_id_from_all_forums($group_id); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/extend/buddypress/functions.php  
  1. function bbp_remove_group_id_from_all_forums( $group_id = 0 ) { 
  2.  
  3. // Use current group if none is set 
  4. if ( empty( $group_id ) ) 
  5. $group_id = bp_get_current_group_id(); 
  6.  
  7. // Get current group IDs 
  8. $forum_ids = bbp_get_group_forum_ids( $group_id ); 
  9.  
  10. // Loop through forums and remove this group from each one 
  11. foreach ( (array) $forum_ids as $forum_id ) { 
  12. bbp_remove_group_id_from_forum( $group_id, $forum_id );