I am currently using the wp_roles() function to retrieve all user roles available like this:
<?php
foreach (wp_roles()->get_names() as $role) {
echo translate_user_role( $role );
}
?>
How would I retrieve an array/list of all custom roles that I've created without the default roles (Administrator, Editor, Subscriber, etc) included?
translate_user_role
do? Wouldn't it be easier to use__( ... )
, then you could use the standard core localisation system and the default roles would auto-translate