Hi Nick,
I tested the new version on a new site and can’t reproduce. 2.2.2 explicitly adds the withSpokenMessages
component that was missing and which I think was responsible for your error.
Here’s the code I used to create a book CPT and custom taxonomy “genre”.
/**
* Register a custom post type called "book".
*
* @see get_post_type_labels() for label keys.
*/
function kia_codex_book_init() {
$args = array(
'public' => true,
'label' => __( 'Books', 'textdomain' ),
'supports' => array( 'title', 'editor', 'author', 'thumbnail' ),
'show_in_rest' => true
);
register_post_type( 'book', $args );
}
add_action( 'init', 'kia_codex_book_init' );
/**
* Book Taxonomies
*/
function kia_create_book_taxonomies() {
// Add new taxonomy, make it hierarchical (like categories)
$labels = array(
'name' => _x( 'Genres', 'taxonomy general name', 'textdomain' ),
'singular_name' => _x( 'Genre', 'taxonomy singular name', 'textdomain' ),
'search_items' => __( 'Search Genres', 'textdomain' ),
'all_items' => __( 'All Genres', 'textdomain' ),
'parent_item' => __( 'Parent Genre', 'textdomain' ),
'parent_item_colon' => __( 'Parent Genre:', 'textdomain' ),
'edit_item' => __( 'Edit Genre', 'textdomain' ),
'update_item' => __( 'Update Genre', 'textdomain' ),
'add_new_item' => __( 'Add New Genre', 'textdomain' ),
'new_item_name' => __( 'New Genre Name', 'textdomain' ),
'menu_name' => __( 'Genre', 'textdomain' ),
);
$args = array(
'hierarchical' => true,
'labels' => $labels,
'show_ui' => true,
'show_in_rest' => true,
'show_admin_column' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'genre' ),
'default_term' => array( 'name' => 'My default genre', 'slug' => 'default-genre' ),
);
register_taxonomy( 'genre', array( 'book' ), $args );
}
add_action( 'init', 'kia_create_book_taxonomies' );
Could you make sure to flush any caches? to ensure that you have the latest version of js/dist.js
?