Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Talk:Function Reference/register taxonomy

This doesn't make sense to me, found under the show_in_menu argument:

   Note: As this one inherits its value from show_ui, which inherits its value from public, it seems to be the most reliable property to determine, if a taxonomy is meant to be publicly useable.

Why not just look at public to determine if it's publicly consumable? It might be hidden from the menu because it's managed elsewhere, but still publicly consumable. I'm removing this because I think it's incorrect... feel free to revert if I'm misunderstanding something.

Mslade (talk) 20:20, 23 October 2015 (UTC)

"better be safe than sorry" warning is baffling

This line:

   Better be safe than sorry when registering custom taxonomies for custom post types. Use register_taxonomy_for_object_type() right after the function to interconnect them. Else you could run into minetraps where the post type isn't attached inside filter callback that run during parse_request or pre_get_posts.

No idea what this means or whether it's legitimate. Is it saying we shouldn't use the second parameter of register_taxonomy to connect a taxonomy to a post type? At the very least needs a better explanation for potential complications than the last sentence provides.

query_var explanation conflicts with Example.

In the segment where register_taxonomy arguments are broken down, it states that 'true' is not seen as a valid entry.

"query_var (boolean or string) (optional) False to disable the query_var, set as string to use custom query_var instead of default which is $taxonomy, the taxonomy's "name". True is not seen as a valid entry and will result in 404 issues."

Further down in the examples, both Genre and Writer use 'query_var' => true.

This could be, and well is, confusing for those reading through all the details trying to get a better handle on how everything actually works.