Make WordPress Core

Opened 8 years ago

Closed 6 years ago

#38053 closed defect (bug) (duplicate)

register_taxonomy capabilities not taken into account with metabox

Reported by: bjornw's profile BjornW Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.6.1
Component: Taxonomy Keywords:
Focuses: Cc:

Description

When registering a new custom taxonomy with register_taxonomy() I use the following capabilities array in the registration:

<?php      
'capabilities' => array(
  'manage_terms'  => 'activate_plugins',
  'edit_terms'    => 'activate_plugins',
  'delete_terms'  => 'activate_plugins',
  'assign_terms'  => 'edit_posts'
),

Users without the capability 'activate_plugins' are not shown the custom taxonomy in the main wp-admin interface. However they are still able to add new terms in the metabox shown in the custom post type connected with this custom taxonomy, which is not what I'd expect. I'd expect users to be able to assign existing terms, but not to add any new terms.

Attachments (3)

custom-taxonomy-logged-in-as-role-admin-annotated.png (80.1 KB) - added by BjornW 8 years ago.
Annotated screenshot logged in with role admin
custom-taxonomy-logged-in-with-role-editor-annotated.png (84.5 KB) - added by BjornW 8 years ago.
Annotated screenshot logged in with role editor
issue-38053.php (2.5 KB) - added by BjornW 8 years ago.
Tiny plugin to demonstrate the issue

Download all attachments as: .zip

Change History (7)

@BjornW
8 years ago

Annotated screenshot logged in with role admin

@BjornW
8 years ago

Annotated screenshot logged in with role editor

@BjornW
8 years ago

Tiny plugin to demonstrate the issue

This ticket was mentioned in Slack in #core by bjornw. View the logs.


8 years ago

This ticket was mentioned in Slack in #core by bjornw. View the logs.


7 years ago

#3 @grapplerulrich
6 years ago

I think this is a duplicate of #26409

#4 @johnbillion
6 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #26409.

Note: See TracTickets for help on using tickets.