How to programatically remove a user to a group
-
I am working on a site that allows students to enroll in classes. When they enroll in a class, I want to automatically add them to the class group. And if they cancel the enrollment, I want to automatically remove them.
I found this in the documentation
Groups_User_Group::create( array( 'user_id' => $user_id, 'group_id' => $group_id ) );
After digging in the source a little, I am guessing that this is the way to remove:
Groups_User_Group::delete ( $user_id, $group_id ) );
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘How to programatically remove a user to a group’ is closed to new replies.