Hello,
We have a problem. If someone comments on our site using Twitter or Facebook or other social network then he automatically gets an account. The problem is that we automatically assign our new users a Trial role (for our possible future writers) with some important rights for them.
But we don't want to have the same role assigned to people only commenting and using a login button via some social network. They must remain and keep the User role and not any other.
How can we do it??
Thank you.
Regards,
Karel
Users who login first time get the default user role which has been set in WordPress Settings > General admin page:
wpDiscuz calls WordPress user creating function, and it does all next steps. wpDiscuz doesn't have any control over the user creating and role assigning process. It just calls WordPress functions and says create a user with this email (social login account email), that's it. So you should do either change the default user role or find a way to control user creating function of WordPress.
wp_create_user()
is a simple function to create a new WordPress user.wp_insert_user()
function is the big brother of thewp_create_user()
function.