Approve account when email is gmail
-
With this code it is possible to change the role of a user if his email is gmail.
add_action("um_registration_complete","um_042121_change_user_role", 1, 2 ); function um_042121_change_user_role( $user_id, $args ){ if( isset( $args['user_email'] ) ){ list($user, $domain) = explode('@', $args['user_email'] ); if ($domain == 'gmail.com') { wp_update_user( array( 'ID' => $user_id, 'role' => 'premium-member' ) ); } } }
Is it also possible is the account status approved when the email is gmail? And so wait for the approval of the account? Thanks.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Approve account when email is gmail’ is closed to new replies.