I have a custom taxonomy, "Type" and I have it registered to my custom post type "Resource." But if I enable "show_in_rest" I get a JS error:
TypeError: Cannot read property 'transientEdits' of undefined
and Gutenberg doesn't load up.
Here's my tax:
$args = array(
'labels' => $labels,
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_admin_column' => true,
'show_in_nav_menus' => true,
'show_tagcloud' => true,
'show_in_rest' => true,
);
register_taxonomy( 'type', array( 'resource' ), $args );
Thanks in advance for any advice.
I have a custom taxonomy, "Type" and I have it registered to my custom post type "Resource." But if I enable "show_in_rest" I get a JS error:
TypeError: Cannot read property 'transientEdits' of undefined
and Gutenberg doesn't load up.
Here's my tax:
$args = array(
'labels' => $labels,
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_admin_column' => true,
'show_in_nav_menus' => true,
'show_tagcloud' => true,
'show_in_rest' => true,
);
register_taxonomy( 'type', array( 'resource' ), $args );
Thanks in advance for any advice.
Share Improve this question asked Sep 18, 2019 at 17:42 ColinColin 1212 gold badges3 silver badges8 bronze badges1 Answer
Reset to default 2Changing the taxonomy name fixes. I'll wager the guess that having it called 'type' was conflicting with the Gutenberg js.
$args = array(
'labels' => $labels,
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_admin_column' => true,
'show_in_nav_menus' => true,
'show_tagcloud' => false,
'show_in_rest' => true,
);
register_taxonomy( 'resource-type', array( 'resource' ), $args );