I have registered a custom taxonomy in Wordpress, and I can't work out why it is not displaying in standard Wordpress posts, since Gutenberg has been introduced. What I mean by this, is that it does not display in the document sidebar when adding or editing a post. The same is true for 'Categories' and 'Tags', which are obviously standard taxonomies.
I have ensured 'show_in_rest' => true is present is the taxonomy registration, but it hasn't made any difference.
It seems that they are partially registering, as they show up under 'Posts' in the main left hand menu, which suggests it might be Gutenberg related?
Any ideas?
// Register taxonomy
add_action( 'init', 'register_taxonomy_articles_element' );
function register_taxonomy_articles_element() {
$labels = array(
'name' => _x( 'Elements', 'articles_element' ),
'singular_name' => _x( 'Element', 'articles_element' ),
'search_items' => _x( 'Search Elements', 'articles_element' ),
'popular_items' => _x( 'Popular Elements', 'articles_element' ),
'all_items' => _x( 'All Elements', 'articles_element' ),
'parent_item' => _x( 'Parent Element', 'articles_element' ),
'parent_item_colon' => _x( 'Parent Element:', 'articles_element' ),
'edit_item' => _x( 'Edit Element', 'articles_element' ),
'update_item' => _x( 'Update Element', 'articles_element' ),
'add_new_item' => _x( 'Add New Element', 'articles_element' ),
'not_found' => _x( 'No Elements found', 'articles_element' ),
'new_item_element' => _x( 'New Element', 'articles_element' ),
'separate_items_with_commas' => _x( 'Separate Elements with commas', 'articles_element' ),
'add_or_remove_items' => _x( 'Add or remove elements', 'articles_element' ),
'choose_from_most_used' => _x( 'Choose from the most used elements', 'articles_element' ),
'menu_name' => _x( 'Elements', 'articles_element' )
);
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_in_nav_menus' => true,
'show_in_rest' => true,
'show_ui' => true,
'show_tagcloud' => true,
'hierarchical' => true,
'rewrite' => true,
'query_var' => true
);
register_taxonomy( 'element', array('post'), $args );
}