(first of all excuse me for my bad English writing)
in last 2 days my WordPress website have a problem.
when every one sign up on my website become an admin !!!
I try all possible solutions but not work.
I need a hook to force all new registered users to only have a "customer" role. or immediately auto change there role to customer from admin after signup
I use DIGITS plugin for signup form (OTP plugin)
I use this code but not working:
function my_func1($user_id){
$wp_user_object = new WP_User($current_user->ID);
$wp_user_object->set_role('customer');
}
add_action('user_register','my_func1');
2
Answers
go to Dashboard>setting>new user role> set it to customer or Subscriber.
If this doesn’t help then you can install Ultimate member plugin and force all users to customer roles
This should solve your problem