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

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.