Plubo Roles
WordPress roles simplified.
composer require joanrodas/plubo-roles
You can also install Plubo Roles as a standalone WordPress plugin, simply downloading the zip and placing it in the plugins folder.
<?php
PluboRoles\RolesProcessor::init();
add_filter('plubo/roles', function($roles) {
$roles[] = pb_role('student', 'Student')->extend('subscriber')->addCaps(['view_lesson', 'view_task']);
$roles[] = pb_role('instructor')->extend('contributor')->restrictAdmin();
$roles[] = pb_role('subscriber')->rename('Member');
return $roles;
}); ?>
Feel free to contribute to the project, suggesting improvements, reporting bugs and coding.