-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to make custom taxonomy appear on Gutenberg-enabled post types? #11106
Comments
@deckerweb it should work without any special changes if you support |
It is part of my plugin "Builder Template Categories" and here's the register function: Ok, you are saying it has to be also "public" -- which is currently not, as this taxonomy is only intended for internal purposes to organize things, mmh don't know how to go forward then... |
@deckerweb You can also turn EDIT: I see you did that already. Let me play around and see… |
So one thing to check would be the taxonomies endpoint of the REST API ( The code that adds the taxonomy panels is here:
And you can see that the only check there is for taxonomies with show_ui = true. |
Thanks for the feedback! :) I already played around with "public" => TRUE but it makes no difference as of now (no meta box for tax) |
@deckerweb the only other thing I noticed is that you don't appear to be setting a post type for the taxonomy: The editor will only show taxonomies that are enabled for the post type, so you might just need to register the support for your type. |
Yes, the adding of a post type happens conditionally for any integration (of template type plugins with a post type...) --- which works like a charm |
@deckerweb if you're not explicitly setting the post type relations inside your |
This is what I get for the tax endpoint - the output is identical for show_ui TRUE or FALSE:
|
Ok, when passing |
@chrisvanpatten Thanks again for your feedback and pointing me in the right direction! I found a working solution which also works with my conditionally adding of the tax to certain post types. |
I'm looking for Gutenberg works with custom post types or Post Category, post tags |
@couponrim I noticed this issue mentions a plugin which is registering taxonomies and I thought maybe it could help you as a working example if you look at that code: I found this which explains how to make a custom post type work with Gutenberg: https://wordpress.stackexchange.com/questions/324221/enable-gutenberg-on-custom-post-type I'm not sure where to point you for information about "Post Category, post tags" and would like to suggest that you should ask for help either at https://wordpress.org/support/forum/wp-advanced/ or at https://wordpress.stackexchange.com/ to start because those places are more appropriate for help requests while GitHub repositories like this one are generally more restricted in terms of posting bug reports and feature requests, especially after the Gutenberg code merged to WordPress Core in WordPress 5.0, and those support resources should also be able to help you sort out how to ask more detailed questions and include code examples for things you've already tried if you have already tried anything. To successfully get help with such requests, it's really good to include details such as a short explanation of exactly what you're trying to do, what you've tried already, and any code examples that you have either already tried or that you have reviewed and are wanting to learn more about. |
@designsimply |
Hi there!
How can I make a custom taxonomy appear on Gutenberg-enabled post types?
I tried a lot of code snippets in the last weeks but none of them worked (I guess most were a few months old, and Gutenberg changed things in the last weeks?). Then I did find out that Gutenberg in the whole area of "Meta Box" support strips out meta boxes from custom taxonomies.
This is really bad and should not be the case. I found they have a filter available but I cannot cope with it currently as their used terminology is not entirely clear to me at what this filter really does and how:
or:
In general I am fine in working with filters as I do plugins myself ;-) However in this special case I am totally struggleing with it as it is not clear how to me how Gutenberg works in this area.
Thanks for any tips and help to point me in the right direction!
The text was updated successfully, but these errors were encountered: