I created a custom user role in WordPress:
add_role('warehouse', 'Warehouse', get_role('administrator')->capabilities);
How to add translations for the role name so that it shows up in admin dashboard in the correct language based on the preferences of the currently logged in admin?
Adding a basic translation function call does not seem to help as add_role function runs once and then fetches the saved role from DB.
add_role('warehouse', __('Warehouse', 'mytextdomain'), get_role('administrator')->capabilities);
Pavol Eichler is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.