[wp-trac] [WordPress Trac] #52726: Allow default term when a user does not have assign_terms capability
WordPress Trac
noreply at wordpress.org
Fri Mar 5 18:21:04 UTC 2021
#52726: Allow default term when a user does not have assign_terms capability
--------------------------+-----------------------------
Reporter: jeremyfelt | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Taxonomy | Version: 5.5
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
After #43517, it is possible to register a default term along with a
custom taxonomy, similar to how WordPress has long supported a default
category.
If I set the `assign_terms` capabilities on the `category` taxonomy to be
`manage_categories` (admin/editor) and set a default category, authors are
able to create new posts and those posts are assigned a default category.
Authors are not able to adjust the categories.
If I adjust the `assign_terms` capabilities on a custom taxonomy to be
`manage_categories` and set a default term, authors are able to create new
posts, but **no** default term is assigned.
The current assignment of the default term is wrapped in the same logic as
the assignment of non-default terms and happens within `current_user_can(
$taxonomy_obj->cap->assign_terms )`.
I would expect that default term assignment should happen outside of that
`current_user_can()` check if no other terms are assigned.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/52726>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list