Make WordPress Core

Opened 3 years ago

Last modified 4 months ago

#57619 new enhancement

register_taxonomy doesn't check for reserved terms

Reported by: milossh's profile milossh Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords: 2nd-opinion
Focuses: coding-standards Cc:

Description

Implement a check in register_taxonomy for reserved terms.

Attachments (1)

2025-07-11_17-02-44.png (42.8 KB) - added by oglekler 4 months ago.

Download all attachments as: .zip

Change History (2)

#1 @oglekler
4 months ago

  • Keywords 2nd-opinion added

I had a list of 13 taxonomies to register for certain CPT. Of course, I knew about reserved terms, but It didn't occur to me to check and as the result I registered "themes" taxonomy. It worked fine, but I got a side effect that was difficult to discover as editors were using Thumbnail block to add Thumbnail and no one was complaining that "Set featured image" button is gone.

I think _doing_it_wrong() will be very useful to notify that word is reserved and cannot be used as taxonomy.

Note: See TracTickets for help on using tickets.