[wp-trac] [WordPress Trac] #35614: Cannot check capabilities on single taxonomy terms
WordPress Trac
noreply at wordpress.org
Tue Jan 26 03:09:08 UTC 2016
#35614: Cannot check capabilities on single taxonomy terms
-----------------------------+-------------------------------------
Reporter: johnjamesjacoby | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Taxonomy | Version:
Severity: normal | Keywords: needs-patch 2nd-opinion
Focuses: |
-----------------------------+-------------------------------------
Unlike Users and Posts, Taxonomy Terms do not have single capability
checks.
Users and Posts have single capabilities that are accompanied by an ID,
like:
* `edit_user`
* `edit_post`
Taxonomy terms however, are only ever checked via their plural version,
like:
* `manage_categories`
In `register_taxonomy()`, the default caps are mapped like:
{{{
$default_caps = array(
'manage_terms' => 'manage_categories',
'edit_terms' => 'manage_categories',
'delete_terms' => 'manage_categories',
'assign_terms' => 'edit_posts',
);
}}}
But there is no single equivalent, like:
* `manage_term`
* `edit_term`
* `delete_term`
* `assign_term`
This means it's not currently possible (even with filters) to target
specific terms in a taxonomy and prevent them from being edited, deleted,
or assigned.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35614>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list