Skip to content

Commit

Permalink
Require custom capabilities to manage/edit/delete shadow terms
Browse files Browse the repository at this point in the history
This prevents UI appearing in the admin without impacting the
existing logic in this plugin for creating, editing, and deleting
terms.

Fixes #20.
jeremyfelt committed Feb 23, 2024
1 parent 3a637f0 commit f88c5b5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions includes/taxonomy.php
Original file line number Diff line number Diff line change
@@ -67,6 +67,11 @@ function register_taxonomy( string $post_type ): void {
'publicly_queryable' => false,
'rewrite' => false,
'hierarchical' => true,
'capabilities' => array(
'manage_terms' => 'override_shadow_terms',
'edit_terms' => 'override_shadow_terms',
'delete_terms' => 'override_shadow_terms',
),
'show_ui' => true,
'show_in_menu' => false,
'show_in_nav_menus' => false,

0 comments on commit f88c5b5

Please sign in to comment.