Make WP admins instructors too, with an Access toggle page #29
Reference in New Issue
Block a user
Delete Branch "feature/admin-access-control"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
A WordPress administrator inherited every studio-admin capability but not
manage_availability(an instructor-only cap). For a single-instructor business where the owner runs the site as the admin, that meant no "My Availability" menu and no way to act as the instructor — the availability feature was unreachable from the only account they had.What changed
RoleManagerextracts the instructor cap set intoINSTRUCTOR_CAPSand grants it to administrators alongside the studio-admin caps, via the existing dynamicuser_has_capfilter (nothing persisted; reverts on deactivation).AccessSettings+templates/admin/access.php) exposes two toggles — "WordPress administrators are Studio Admins" and "are Instructors" — stored asus_admin_grant_studio/us_admin_grant_instructor, both default on so existing installs are unchanged.manage_optionscapability — which the plugin never grants or revokes — so an administrator can always reach it to re-enable a grant. Disabling one can never lock them out.30.5), and the leading studio sidebar separator now shows for any administrator so the grouping stays intact even with both grants off.Use cases
us_studio_admin/us_instructoraccounts run the studio and administrators don't appear as studio staff.Checks
composer test(185 tests, 532 assertions),composer lint(PHPStan L6 — no errors),composer cs(PHPCS) all green. NewAccessSettingsTest;RoleManagerTestgains toggle coverage;docs/features/user-roles.mdupdated.🤖 Generated with Claude Code