bp_groups_get_activity_group( integer $group_id )

Get the group object the activity belongs to.


Parameters Parameters

$group_id

(integer) (Required) The group ID the activity is linked to.


Top ↑

Return Return

(BP_Groups_Group) The group object the activity belongs to.


Source Source

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

function bp_groups_get_activity_group( $group_id = 0 ) {
	// If displaying a specific group, check the activity belongs to it.
	if ( bp_is_group() && bp_get_current_group_id() === (int) $group_id ) {
		$group = groups_get_current_group();

		// Otherwise get the group the activity belongs to.
	} else {
		$group = groups_get_group( $group_id );
	}

	return $group;
}


Top ↑

Changelog Changelog

Changelog
Version Description
5.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.