| | |
| | | $content = jvbNoBase($content); |
| | | $registrar = Registrar::getInstance($content); |
| | | if ($registrar && $registrar->getPlural()) { |
| | | return str_replace(' ', '_', $registrar->getPlural()); |
| | | return strtolower(str_replace(' ', '_', $registrar->getPlural())); |
| | | } |
| | | return str_replace(' ', '_', $content.'s'); |
| | | return strtolower(str_replace(' ', '_', $content.'s')); |
| | | } |
| | | |
| | | public static function activate(): void |
| | |
| | | } |
| | | return null; |
| | | } |
| | | public static function getPermissionName(string $action, string $content, ?int $ID = null):?string |
| | | { |
| | | $plural = (new self())->getContentPlural($content); |
| | | switch ($action) { |
| | | case 'edit': |
| | | if ($ID) { |
| | | return "edit_{$content}"; |
| | | } |
| | | return "edit_{$plural}"; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public function maybeSwitchPermissions(int $object_id, array $terms, array $tt_ids, string $taxonomy, bool $append, array $old_tt_ids):void |
| | | { |