I’m using CPT UI to manage all my custom CPTs and taxonomies. I’ve tried adding custom taxonomy with slug type
, and CPT UI displays an error saying that type
is reserved term.
Now, if I try register_taxonomy
and use type
as tax slug, everything works just fine. Can someone explain how can this be?
That’s because some terms are reserved by WordPress core and shouldn’t be used as custom
slug
. However, WordPress core itself doesn’t check withinregister_taxonomy
function whether a developer has used those reserved terms or not. It’s up to the developers to read the documentation and implement accordingly. These core functions are low level implementations, so developers have more freedom and power with these functions.On the other hand, Custom Post Type UI plugin is more of a user facing implementation, hence it doesn’t expect its users to read all the documentation as a more advanced developer is supposed to. So it takes care of the reserved terms.
You can check the code of CPT UI’s cptui_reserved_taxonomies() function to check how it is implemented.
FYI, the following is from
WordPress developer documentation
on reserved terms: