bbp_get_group_forum_ids( type $group_id )
Get forum ID’s for a group
Description
Parameters
- $group_id
-
(Required)
Source
File: bp-forums/functions.php
function bbp_get_group_forum_ids( $group_id = 0 ) { // Assume no forums $forum_ids = array(); // Use current group if none is set if ( empty( $group_id ) ) $group_id = bp_get_current_group_id(); // Get the forums if ( !empty( $group_id ) ) $forum_ids = groups_get_groupmeta( $group_id, 'forum_id' ); // Make sure result is an array if ( !is_array( $forum_ids ) ) $forum_ids = (array) $forum_ids; // Trim out any empty array items $forum_ids = array_filter( $forum_ids ); return (array) apply_filters( 'bbp_get_group_forum_ids', $forum_ids, $group_id ); }
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.