-
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
Gutenberg doesn't show metaboxes for Tags & Categories, for custom post types #19388
Comments
Interesting. @youknowriad would you be able to tell me what Wordpress / Gutenberg versions you use? Thanks ! |
I'm using master (this is Gutenberg 7.2 approximatively) but I'm pretty sure we didn't touch this code for a long time now. |
Thanks @youknowriad . I have reinstalled a fresh Wordpress 5.3.2, with TwentyNineteen as theme. I have added Gutenberg 7.3 as plugin. I have added the CPT definition in functions.php (I've tried at the top of it, at the bottom of it). And still don't see Tags or Categories metaboxes in the right-hand side column. Really don't get what can be different between my setup and yours ... What mystery. |
I think the issue is that you should run the CPT creation on the "init" hook and not at the root of the file. this should fix it. |
@youknowriad THANK YOU SO MUCH !!! I had this problem opened for 8 months, was unable to put my head around this... And it was a matter of reading properly the documentation for register_post_type ... Thank you very much again, as I wouldn't have solved this by myself. |
When enabling a custom post type for default taxonomies "category" and "post_tag", Gutenberg doesn't show the Tags & Categories metaboxes in the right-hand panel.
Steps to reproduce the behavior:
I have installed a fresh WordPress setup; using TwentyNineteen as theme.
In functions.php, I have created my post type using the following piece of code:
In WordPress Admin, I can create a new “album” without any problem, but don’t see the metabox to create tags (as I do see when creating a post)
On the page to create a new “album”, when checking “3 dots > Options”, I don’t see the option to display the “Tags” metabox.
When debugging, and doing “print_r($wp_taxonomies);”, I can see that my custom post type “album” is registered within the “[object_type]” array of “[post_tag] => WP_Taxonomy Object”
Issue reproduced on 3 different instances of Wordpress.
Expected behavior : I expect a metabox to manage Tags & Categories, to appear on the right-hand side, as I do have when managing posts.
Desktop (please complete the following information):
PS: a support request has been created, but I have been advised to open a bug request instead - https://wordpress.org/support/topic/custom-post-types-gutenberg-tags-2-2/
The text was updated successfully, but these errors were encountered: