I want to get the GROUP_creator_id when an user joins any GROUP. So if I got the group_id after immediately performing the the groups_join_group action by add_action() method.


$group_id is the first argument passed to groups_join_group action hook function, the second argument is $user_id. You can use these data to obtain group creator_id like:

add_action('groups_join_group', 'my_groups_join_group_action', 10, 2);

function my_groups_join_group_action($group_id, $user_id) {
    // use $group_id and $user_id here:
    $group = groups_get_group( array( 'group_id' => $group_id ) );
    $creator_id = $group->creator_id;
  • Thanks a bundle :) Its worked like a charm :) Thanks again and again – user1460692 Nov 30 '12 at 7:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.