groups_get_current_group()

Get the BP_Groups_Group object corresponding to the current group.

Description

Return

(BP_Groups_Group) The current group object.

Source

File: bp-groups/bp-groups-functions.php

1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
function groups_get_current_group() {
    $bp = buddypress();
 
    $current_group = isset( $bp->groups->current_group )
        ? $bp->groups->current_group
        : false;
 
    /**
     * Filters the BP_Groups_Group object corresponding to the current group.
     *
     * @since BuddyPress 1.5.0
     *
     * @param BP_Groups_Group $current_group Current BP_Groups_Group object.
     */
    return apply_filters( 'groups_get_current_group', $current_group );
}

Changelog

Changelog
Version Description
BuddyPress 1.5.0 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.