Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

1 Answer 1

up vote 1 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.