Any Ideas? I want to write a simple plugin that shows the tree of hierarchial groups. I can’t belive that there is no easier way than quering the database…
`bp_get_group_id()`
or:
`global $bp;
$bp->groups->current_group->id;`
Thanks, but did you read my question?
I have all the Id’s, I want to access their names and permalinks to show in the list.
For example, I need to show links to groups 1, 12, 42 and 99, in the sidebar, I don’t need current group Id for that
I needed to do this recently too… this is the technique I used:
$group = groups_get_group( array( ‘group_id’ => $group_id ) );
Found on http://bluemandala.com/buddypress-plugin/127/buddypress-get-group-details-from-group_id/
So in order to get the link to your groups try something like this
global $bp;
$group = groups_get_group( array( ‘group_id’ => $group_id ) );
home_url( $bp->groups->slug . ‘/’ . $group -> slug )
Thank’s a lot, drebabels!