Reply To: [Resolved] Display groups a user is member of
Thank you for your reply.
I did come across that thread earlier, but the answers didn’t seem to work for me.
Anyway, I used the groups_get_user_groups() function you mentioned in your reply and came up with a solution doing what I was looking for along with comma separation of the group names:
<?php
$group_ids = groups_get_user_groups(bp_displayed_user_id());
foreach($group_ids["groups"] as $group_id) {
echo(groups_get_group(array( 'group_id' => $group_id )) -> name . (end($group_ids["groups"]) == $group_id ? '' : ', ' ) );
}
?>