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

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 –  Ka Ba Su Nov 30 '12 at 7:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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