Add action when user is approved
-
I’m trying to integrate your plugin with the Groups membership plugin so when a user is approved, they are assigned a designated group to gain access to restricted content. I need to have the user ID in order to assign the appropriate group.
So far in my functions.php I have:
add_action( 'new_user_approve_user_approved', 'change_user_confirmed_group', 18 ); function change_user_confirmed_group( $user_id ) { $user = new WP_User( $user_id ); $user_role = $user->roles[0]; ...assign group to user based on role }Is this the best way to capture the $user_id being used by the new_user_approve_user_approved action?
Thanks ahead for you assistance.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Add action when user is approved’ is closed to new replies.