Make WordPress Core

Opened 3 years ago

#52726 new defect (bug)

Allow default term when a user does not have assign_terms capability

Reported by: jeremyfelt's profile jeremyfelt Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.5
Component: Taxonomy Keywords:
Focuses: Cc:


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.

Change History (0)

Note: See TracTickets for help on using tickets.