Closed sethburtonhall closed 7 years ago
Hi @middle8media
I don't think it's easy to build this logic automatically since this case could vary a lot for each implementation of Groups.
You could simply do this when a user is updated (or in your case activated).
add_action( 'profile_update', 'my_theme_remove_pending_group' );
function my_theme_remove_pending_group() {
$activated = false;
// << Check if your user is activated or not. Not sure how your activation process is working so can't provide you this code..
if ( true == $activated ) {
$group_id = 1; // << change this to the ID of the "Pending" group
// Here we delete this user from the "Pending" group
Groups_User_Group::delete( $user_id, $group_id );
}
}
I have a Gravity membership registration form that assigns a "Pending" group upon submission.
As of now, the admin manually removes the "Pending" group once they activate the member, but I am wondering if it is possible to automatically remove that "Pending" group from the user once the admin activates their account?