Skip to content
Advertisement

BuddyPress, get url (link) of a group using the group id

I’am getting the id of a group using:

$group = groups_get_group( array( 'group_id' => $id) );

But for the life of me I can’t figure out how to return the link to the group its self.

I can grab the slug, but some groups are sub groups so I can’t just:

echo 'domain/groups/'.$group->slug;

Any help greatly appreciated.

Advertisement

Answer

Did you try:

bp_get_group_permalink( $group );

That will return the href value for the group. To get an html link use:

bp_get_group_link( $group );
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement