WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

closed as off-topic by toscho Aug 2 '14 at 20:54

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 2 down vote accepted

$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;
share|improve this answer
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.