Why is my working Custom Taxonomy not in get_taxonomies array?

The Invalid Taxonomy error will be raised by the function get_terms(). You’re registring your taxonomy on the init action hook. Therefore you have to call your get_terms() function on the same or a later hook. Try this snippet. It should display all term names of your taxonomy, regardless if the term is empty. add_action(‘init’, ‘wpse29164_registerTaxonomy’); … Read more

Hide the term description on the term edit page, for a given taxonomy

You could target the edit form for the post_tag taxonomy, through the post_tag_edit_form hook: /** * Hide the term description in the post_tag edit form */ add_action( “post_tag_edit_form”, function( $tag, $taxonomy ) { ?><style>.term-description-wrap{display:none;}</style><?php }, 10, 2 ); Here you can also target an individual tag. If you need something similar for other taxonomies, you … Read more

Is there a way to ‘Lock’ a Taxonomy?

Categories, Tags & Taxonomies First i want to make this one clear: Everything is a Taxonomy. Tags is a non-hierarchical, Categories a hierarchical and both are built-in taxonomies. Same goes for eg. post formats (aside, chat, etc.). It’s the same concept as with post-types (post, page, attachment, nav_menu_item, etc. are all just built in post … Read more

Exclude Specific Term from Search

The basic explanation You have a template tag that is called is_search() to determin if you’re on a search page or not. This then calls get_search_template() which basically is a wrapper function for get_query_template(‘search’). When you look into the last function, then you’ll see that it basically does locate_template(), which checks for file existence and … Read more

Determine Term depth

Not trying to bump my rep, but I found my own answer. get_ancestors allows you to get the hierarchy of any item. Since terms can only have 1 parent, this is all we need: the number of items in this list equates to the term depth level, and even provides term ids. Usage: $ancestors = … Read more