Comments 3Kevin Cross started the conversationNovember 22, 2021 at 6:40pmHi,Is it possible to change the default role for newly created subaccounts from "Customer" to something else?Thanks, 2,218WebWizards repliedNovember 22, 2021 at 7:23pmHi Kevin,Yes, you can do that with a PHP code snippet. The snippet is: add_action('b2bking_after_subaccount_created', function($user_id){ $userobj = new WP_User($user_id); $userobj->set_role('editor'); }, 10, 1); In the above, replace "editor" with any role that you want.You can add the above to functions.php or by using our guide here https://woocommerce-b2b-plugin.com/docs/how-to-add-a-snippet-php-or-js/Kind regards,Stefan Sign in to reply ...
Hi,
Is it possible to change the default role for newly created subaccounts from "Customer" to something else?
Thanks,
Hi Kevin,
Yes, you can do that with a PHP code snippet.
The snippet is:
In the above, replace "editor" with any role that you want.
You can add the above to functions.php or by using our guide here https://woocommerce-b2b-plugin.com/docs/how-to-add-a-snippet-php-or-js/
Kind regards,
Stefan