Get group details from group_id – BuddyPress Snippet

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
1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 3.00 out of 5)
Loading...Loading...
Oopps, sorry. This discussion is closed.

If you are a paying customer and you are looking for Tech Support please post a ticket on our Support Tickets page and we will respond promptly.

If you are not a paying customer and you would like to post a pre-sale question or a quote request please use our Contact form.

Why did we close the discussion?

Many of the customers started reporting issues as comments instead of the ticketing system and this started delaying our response time.

We are making this change to serve our customers better. We have ramped up our support team and we are trying to get the reply out on the same day.

Thanks for understanding.

maise_sqc@mailxu.com hickockilse@mailxu.com swineyjulieann