bbp_remove_forum_id_from_group( type $group_id,  $forum_id )

Remove a forum from a group

Description

Parameters

$group_id

(Required)

Source

File: bp-forums/functions.php

475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
function bbp_remove_forum_id_from_group( $group_id = 0, $forum_id = 0 ) {
 
    // Validate forum_id
    $forum_id = bbp_get_forum_id( $forum_id );
 
    // 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 );
 
    // Maybe update the groups forums
    if ( in_array( $forum_id, $forum_ids ) ) {
        $forum_ids = array_diff( array_values( $forum_ids ), (array) $forum_id );
        return bbp_update_group_forum_ids( $group_id, $forum_ids );
    }
}

Changelog

Changelog
Version Description
bbPress (r3653) Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.