I have created a custom role that I've named customer
public function setup_user_roles()
{
add_role('customer', 'Customer', $customer_capabilities);
add_role('moderator', 'Moderator', $moderator_capabilities);
}
I've used the plugin registration hook to add them and the capabilities are only read
for the customer
and only edit_users
for moderator role. I need to give to users te ability to modify only their own profile informations and for modeartors the ability to approve accounts. Not sure if I need to add other capabilities to achive this, at the moment the two roles are added to wp roles and seems working as expected. What I need is to have the accounts of the customers not able to login until thay are approved from a moderator. I've added a custom meta field that will have the status pending
, approved
or rejected
but how I can rely on it when users try to login? Is there a better way for this without an external plugin?