Make WordPress Core

Opened 10 years ago

Closed 9 years ago

#38053 closed defect (bug) (duplicate)

register_taxonomy capabilities not taken into account with metabox

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

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 10 years ago.
Annotated screenshot logged in with role admin
custom-taxonomy-logged-in-with-role-editor-annotated.png (84.5 KB ) - added by BjornW 10 years ago.
Annotated screenshot logged in with role editor
issue-38053.php (2.5 KB ) - added by BjornW 10 years ago.
Tiny plugin to demonstrate the issue

Download all attachments as: .zip

Change History (7)

@BjornW
10 years ago

Annotated screenshot logged in with role admin

@BjornW
10 years ago

Annotated screenshot logged in with role editor

@BjornW
10 years ago

Tiny plugin to demonstrate the issue

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


10 years ago

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


10 years ago

#3 @grapplerulrich
9 years ago

I think this is a duplicate of #26409

#4 @johnbillion
9 years ago

  • Milestone Awaiting Review
  • Resolutionduplicate
  • Status newclosed

Duplicate of #26409.

Note: See TracTickets for help on using tickets.