bbp_update_forum_group_ids

Update group ID's for a forum.

Description

bbp_update_forum_group_ids( (int) $forum_id = 0, (array) $group_ids = array() ); 

Parameters (2)

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

Usage

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

Defined (1)

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

/includes/extend/buddypress/functions.php  
  1. function bbp_update_forum_group_ids( $forum_id = 0, $group_ids = array() ) { 
  2. $forum_id = bbp_get_forum_id( $forum_id ); 
  3.  
  4. // Trim out any empties 
  5. $group_ids = array_filter( $group_ids ); 
  6.  
  7. // Get the forums 
  8. return update_post_meta( $forum_id, '_bbp_group_ids', $group_ids );