hello, sorry – wrong forum to post in but I can’t see where to post my question.
I am wanting to use Groups_User_Group::create for adding a user to a group. but can’t seem to get it to work.
For testing purposes I am using my test account with user id: ‘email@example.com’ (I use email addresses as the login ID for accounts on my site)
and for testing purposes my group is called “SAGE” – Group id 2
I have set up the following:
Groups_User_Group::create( array( ‘user_id’ => $user_id, ‘group_id’ => $group_id) );
However when I run it, it’s not adding the user to that group.
Am I missing a lot of other required configuration here, or is there just some mis-configuration?
I will, at some point enable a user to add themselves to multiple groups.