Support » Plugin: Custom Post Type UI » Taxonomy does not show up in Gutenberg editor

  • Resolved Matthias Reinholz

    (@matthiasreinholz)


    Hi there,
    I am currently facing an issue with taxonomies.
    When I set up a custom taxonomy for a custom post type, I can see it in the admin menu and also on Gutenberg, but on Gutenberg the taxonomy does not show any entries (even if there are some).

    It is set to hierarchical and I can also see/add all entries from the CPT list quick edit view.

    On Gutenberg, I see the following console / JSON error:
    {“code”:”rest_invalid_param”,”message”:”Invalid parameter(s): orderby”,”data”:{“status”:400,”params”:{“orderby”:”orderby is not one of author, date, id, include, modified, parent, relevance, slug, include_slugs, title.”}}}

    How can I fix this?

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    Do you have “Show In Rest” set to true for your intended taxonomies? Beyond that, I’d need to check into WP core errors around that output above, as it’s a new one to me.

    Thread Starter Matthias Reinholz

    (@matthiasreinholz)

    Yes, it is active. I was looking into this but could not find the reason.
    The taxonomies work fine from all other views but not from the Gutenberg editor.

    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    Hrm. It’s definitely a new error to me.

    I’m seeing it set up and output by a few places inside wp-includes/rest-api/class-wp-rest-request.php and around sanitizing/validating parameters.

    CPTUI itself doesn’t do any direct interfacing with the WP REST API, for what it’s worth.

    Thread Starter Matthias Reinholz

    (@matthiasreinholz)

    It is not a problem right now as I can simply set the categories from the quick edit view. I also did not have the chance to look deeper into this. Maybe there is some issue with another plugin.

    I tried this: https://www.timrosswebdevelopment.com/wordpress-rest-api-post-order/

    It did not help. Doing this, I was able to receive the right output of categories (instead of the error message) in the REST call but they still would not show up from the backend.

    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    Honestly sounds like something beyond the scope of just CPTUI, even though it’s happening with content types registered by our plugin. I imagine you’d be experiencing the same things if you registered them yourself in functions.php at the moment.

    Figured I’d pop in and say I’ve noticed the same issue. When using the Block (Gutenberg) editor, my custom taxonomy for the “Pages” post type went away.

    Show in REST API was set to False, so I changed it to True. It does now show for me. 🙂

    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    With one of the releases since, we’ve defaulted “Show in REST” to true, to help avoid confusion for both taxonomies and post types.

    I am having similar issues. The taxonomy pane in edit show no entries.

    I get these errors from the console:

    [Error] Failed to load resource: the server responded with a status of 400 () (digital_learning, line 0)
    [Error] Failed to load resource: the server responded with a status of 400 () (digital_learning, line 0)
    [Error] Unhandled Promise Rejection: [object Response]
    (anonym funktion)
    promiseReactionJob
    [Error] Failed to load resource: the server responded with a status of 400 () (digital_learning, line 0)
    [Error] Failed to load resource: the server responded with a status of 400 () (digital_learning, line 0)
    [Error] Failed to load resource: the server responded with a status of 404 () (skin.min.css.map, line 0)

    • This reply was modified 2 years, 8 months ago by jayrocket75.

    And then it lists a number of missing json resources:

    /wp-json/wp/v2/digital_learning?per_page=100&orderby=name&order=asc&_fields=id%2Cname%2Cparent&_locale=user

    /wp-json/wp/v2/digital_learning?per_page=100&orderby=count&order=desc&_fields=id%2Cname&_locale=user

    /wp-json/wp/v2/digital_learning?per_page=100&orderby=name&order=asc&_fields=id%2Cname%2Cparent&_locale=user

    • This reply was modified 2 years, 8 months ago by jayrocket75.
    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    @jayrocket75 best I can ask is if you have “Show In REST” and whatnot set to true for your taxonomy settings. Also if you’ve set anything for a REST base slug or not. Beyond that, the issues are stemming more from WP core or possibly conflicts with other plugins.

    I had same problem without errors. Since we’re using WP as headless CMS to a PWA, the cache for the API was the problem. After I cleared API cache it started to show in panel.

    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    Good info to know, regarding cache clearing.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Taxonomy does not show up in Gutenberg editor’ is closed to new replies.