Skip to content

Add functionality to TermSelector to prevent editors from creating new terms #836

@nikkifurls

Description

@nikkifurls

Description

Currently, the TermSelector component allows new terms to be created, if they don't already exist. This is handled via the __experimentalValidateInput prop on the FormTokenField Gutenberg component. When an editor enters a term that doesn't already exist, the new term is created and added to the post automatically.

We should add a prop on TermSelector that will prevent editors from creating new terms.

We should also display a message to editors when they enter a term that doesn't exist.

Use Case

Sometimes, taxonomy terms are managed programmatically, and editors are only allowed to add/remove them from posts, but not allowed to create/edit/delete them. In this case, it would be helpful for the TermSelector to prevent editors from creating new terms that don't already exist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    gutenbergRequires understanding GutenbergjavascriptRequires understanding JavaScript

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions