| | |
| | | return strtolower(str_replace(' ', '_', $registrar->getPlural()??$registrar->getSingular().'s')); |
| | | },array_merge( |
| | | Registrar::getRegistered('post'), |
| | | Registrar::getFeatured('is_content', 'term') |
| | | Registrar::withFeature('is_content', 'term') |
| | | )); |
| | | add_action('set_user_role', [$this, 'updateRoles'], 10, 3); |
| | | |
| | |
| | | protected function addAdminCaps():void |
| | | { |
| | | $users = get_users(['role' => 'administrator']); |
| | | foreach (array_merge(Registrar::getRegistered('post'), Registrar::getFeatured('is_content')) as $slug) { |
| | | foreach (array_merge(Registrar::getRegistered('post'), Registrar::withFeature('is_content')) as $slug) { |
| | | $this->grantRoleCapabilities('administrator', $slug); |
| | | $this->grantRoleOthersCapabilities('administrator', $slug); |
| | | |
| | |
| | | if ($ownable === null) { |
| | | $ownable = array_map(function ($instance) { |
| | | return $instance->slug; |
| | | }, Registrar::getFeatured('is_ownable', 'term')); |
| | | }, Registrar::withFeature('is_ownable', 'term')); |
| | | } |
| | | |
| | | return $ownable; |
| | |
| | | if ($invitable === null) { |
| | | $invitable = array_map(function ($instance) { |
| | | return $instance->slug; |
| | | }, Registrar::getFeatured('invitable', 'term')); |
| | | }, Registrar::withFeature('invitable', 'term')); |
| | | } |
| | | |
| | | return $invitable; |