Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Reply To: How to get the group_id from the “groups_join_group” action in buddypress

@rogercoathup

Participant

The groups_join_group action gets passed the group_id as its first parameter:

e.g. do_action( ‘groups_join_group’, $group_id, $user_id );

So, you have the group_id already.

 

Interestingly, there doesn’t seem to be a function to get the creator – so, you would then either have to:

Create a new BP_Group instance using the group_id, and directly access the it’s ->creator_id attribute, or
Make a direct SQL call on $bp->groups->table_name to return the creator_id where the id = group_id

 

Skip to toolbar