Get group details from group_id – BuddyPress Snippet
June 20, 2013 in Code Snippets by
This is a very simple thing to do but it often takes a lots of time to find.
Here is how to get group details if you have a group id:
$group = groups_get_group( array( 'group_id' => $group_id ) );
You could also add ‘load_users’ => true in the array if you want the members.
Below is an example of the output:
BP_Groups_Group Object ( [id] => 15 [creator_id] => 1 [name] => Demo Group [slug] => demo-group [description] => This is a test group description. [status] => public [enable_forum] => 1 [date_created] => 2013-06-19 11:20:04 [admins] => Array ( [0] => stdClass Object ( [user_id] => 1 [user_login] => johndoe [user_email] => johndoe@dessky.com [user_nicename] => johndoe [is_admin] => 1 [is_mod] => 0 ) ) [total_member_count] => 4 [last_activity] => 2013-06-20 11:20:04 [is_member] => 1

About Milan
The founder of Dessky, Milan has worked in all aspects of advanced web development, from building large commercialized e-commerce and social network systems to troubleshooting small wordpress blogs. His extensive skills cover virtually every area of web development. Milan works hard to implement tomorrow’s trends utilizing the cutting edge systems of today. He specializes in rich internet web application development and deployment, complex HTML5/CSS3 graphical design layouts, full blown framework-driven rich internet applications, and much more. Milan provides elegant solutions to complex problems encountered by businesses that use internet based services. Also he is the Graduated Engineer of both Computer Science and Information Technology.