Issue Class 'Groups_User_Group' not working
-
Hello,
Thanks for your plugin. I’m trying to affect a user automatically to a specific group in a hook.
I’ve found in the support forum this line to add :$current_user = wp_get_current_user();
$user_id = $current_user->id;
$group == 2; // 2 is the group ID I want to affect to the user
Groups_User_Group::create(array( ‘user_id’ => $user_id, ‘group_id’ => $group->group_id ) );But when I run my hook, the user is not affected to the defined group
I have also tried the following without success :Groups_User_Group::create(array( ‘user_id’ => $user_id, ‘group_id’ => $group ) );
Could you provide me with some help on this ?
Many thanks
Pat
The topic ‘Issue Class 'Groups_User_Group' not working’ is closed to new replies.