-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Custom post types with a custom REST controller class are not editable #3462
Comments
Note, as per my Slack post, also affects taxonomies registered in their own namespace in the REST API. |
@greatislander To take this conversation forward a bit, how would you expect this to work? To provide a little bit of background... It's a reasonable assumption that any routes in the However, once we enter the world of arbitrarily defined endpoints (e.g. If you'd like your custom post type to work with Gutenberg, I'd suggest enabling |
Hi @danielbachhuber, thanks for the detailed response. We used the
We proceeded to build major core functionality (for communication between Pressbooks networks) on top of our namespaced custom post type endpoints based on the understanding that this was the preferred way for third-party extensions to work with the REST API. Changing these to To your specific point, I understand that the use of Perhaps an approach to this would be giving plugins a way to tell Gutenberg that their namespaced custom post types and taxonomies support whatever core post type and taxonomy REST API features Gutenberg requires (or support a particular subset of these features). Does this sound like it might be feasible? I noticed that this open PR which removes the Again, thanks for engaging with this issue. I will look into it more this week and see what's changed and if I can think of any more specific approaches. |
Are you aware of this issue? https://core.trac.wordpress.org/ticket/38323 register_meta() currently works globally across all post types, but it does not support registering meta for individual post types. The short version, we tried to do what you proposed but ran into problems. If my custom post type is named 'chapter' and I were to do When we worked on our API our priority wasn't Gutenberg compatibility. It was to have a decent API. Mostly, our post types work fine in the existing editor and i'm not sure what you are proposing will even work? |
Hey folks, @pento and I chatted yesterday (after I posted my original comment), and I think #2457 (comment) is the direction we're heading. Essentially, we're introducing
Yes, although it seems to be a (related but) different topic than this issue. |
@connerbw Commenting for posterity: As of WP 4.9.8, |
Issue Overview
Custom post types registered with a custom REST Controller class are not editable in Gutenberg.
Steps to Reproduce
Expected Behavior
Gutenberg loads the post for editing.
Current Behavior
Gutenberg fails to load the post.
Possible Solution
show_in_rest
cannot load editor #3066, but this is a different bug so I thought it would be worth documenting separately.gutenberg_get_post_to_edit()
assumes that all posts will be in thewp/v2
namespace. Changing this to accommodate namespacing would resolve this issue.gutenberg/lib/client-assets.php
Line 513 in 6eec188
Screenshots / Video
Related Issues and/or PRs
#3066
Todos
The text was updated successfully, but these errors were encountered: