bp_forums_delete_group_forum

Delete a group forum by the group id.

Description

bp_forums_delete_group_forum( (int) $group_id ); 

Parameters (1)

0. $group_id (int)
ID of the group whose forum is to be deleted.

Usage

  1. if ( !function_exists( 'bp_forums_delete_group_forum' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bp-forums-functions.php'; 
  3.  
  4. // ID of the group whose forum is to be deleted. 
  5. $group_id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_forums_delete_group_forum($group_id); 
  9.  

Defined (1)

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

/bp-forums/bp-forums-functions.php  
  1. function bp_forums_delete_group_forum( $group_id ) { 
  2. $forum_id = groups_get_groupmeta( $group_id, 'forum_id' ); 
  3.  
  4. if ( !empty( $forum_id ) && is_int( $forum_id ) ) { 
  5.  
  6. /** This action is documented in bp-forums/bp-forums-screens.php */ 
  7. bb_delete_forum( $forum_id );