My question is "How do I assign a custom user role when a user selects a specific checkbox when registering for an account?"
There is two options: Option 1: Contractor Option 2: Vendor
Registration Flow: #1 User Registers -> Checks either Contractor or Vendor -> Account Created & Assigned a specific user role based on which option they checked.
So far I have the code to create the user flow but I am not sure what conditional logic needs to be added to the additional function.
function contractor_role() {
//add the contractor user role
add_role(
'Contractor',
'Contractor',
array(
'read' => true,
'delete_posts' => false
)
);
}
add_action('admin_init', 'contractor_role');
function vendor_role() {
//add the vendor user role
add_role(
'Vendor',
'Vendor',
array(
'read' => true,
'delete_posts' => false
)
);
}
add_action('admin_init', 'vendor_role');
Aucun commentaire:
Enregistrer un commentaire