1

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.

1

Changing 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 );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.