bbp_update_group_forum_ids

Get forum ID's for a group.

Description

bbp_update_group_forum_ids( (int) $group_id = 0, (array) $forum_ids = array() ); 

Parameters (2)

0. $group_id — Optional. (int)
The group id.
1. $forum_ids — Optional. (array) => array()
The forum ids.

Usage

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

Defined (1)

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

/includes/extend/buddypress/functions.php  
  1. function bbp_update_group_forum_ids( $group_id = 0, $forum_ids = array() ) { 
  2.  
  3. // Use current group if none is set 
  4. if ( empty( $group_id ) ) 
  5. $group_id = bp_get_current_group_id(); 
  6.  
  7. // Trim out any empties 
  8. $forum_ids = array_filter( $forum_ids ); 
  9.  
  10. // Get the forums 
  11. return groups_update_groupmeta( $group_id, 'forum_id', $forum_ids );