joanrodas/plubo-roles

WordPress roles, simplified.

Fund package maintenance!
Ko Fi

v0.1.2 2022-04-24 12:16 UTC

This package is auto-updated.

Last update: 2024-04-24 16:44:21 UTC


README

Plubo Roles

GitHub stars Code Climate maintainability

WordPress roles simplified.


Getting started

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.


Basic usage

<?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;
}); ?>

Contributions

contributions welcome GitHub issues GitHub license

Feel free to contribute to the project, suggesting improvements, reporting bugs and coding.