Last active
August 29, 2015 14:09
-
-
Save i5ar/cf09395ac8de27a4c9e2 to your computer and use it in GitHub Desktop.
Get BuddyPress User's Group
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$group_ids = groups_get_user_groups( bp_loggedin_user_id() ); | |
var_dump( $group_ids["groups"] ); | |
foreach( $group_ids["groups"] as $id ) { | |
$group = groups_get_group( array( 'group_id' => $id ) ); | |
echo '<pre>'; | |
var_dump( $group ); | |
echo '</pre>'; | |
} | |
// Print group name | |
$group_name = $group->name; | |
echo $group_name; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment