Get buddypress group slug by passing its ID

I would like to be able to get a link to a specific buddypress group but by only using the groups ID on a template page.

The admin inputs the groups ID as a custom field on the page, then using this I would like it to be able to generate the groups slug to then create a link to it

Read More

Any help is appreciated

Related posts

1 comment

  1. To get a buddypress group slug from a group id:

    $group_id = 2;    
    $group = groups_get_group( array( 'group_id' => $group_id ) );
    $slug = $group->slug;
    

Comments are closed.