-
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
getPostTypes() limited to 10 #15413
Comments
Here's the code in question: https://github.com/WordPress/gutenberg/blob/a8bc55089eaa5df32b5ed9c36b038ccb066d4062/packages/core-data/src/entities.js Looks like there's no pagination for these API requests. |
There's no pagination but still return 10 results.
return all the results I can't upload a fix because I don't know how to work with function* and yield. If anyone take care of it I appreciate it :) Or if anyone know any workaround using getEntityRecord I appreciate it. It is a big block for my development :( |
Did anyone found a workaround to this? |
I came across this problem as well today. My pragmatic workaround for my development environment was to patch WordPress core.
This allowed me to continue. I imagine it's easy enough to fix the client end to do this for both |
For Gutenberg source I changed
|
It now appears that all I needed to do was to add the
Hopefully, someone will have a look at these 3 comments and let us know what the right solution is. |
Chiming in on the unexpectedness of this. 😄
When I originally used it, I assumed When It seems like certain entities should be aware that results are not paginated. I've also found a couple areas of core code that already use |
I'm closing this as you can do it like @bobbingwide describes here: #15413 (comment) |
I think Gutenberg trying to paginate endpoints that don't have any pagination applied is highly unintuitive and incorrect behavior. At best passing Even if GB does pass a
|
Fortunately I don't yet have 101 post types so I can still use the workaround. This is one of those things where Gutenberg could happily return the complete list of post types and taxonomies on editor load without adding much overhead. It could even return the post types that aren't |
I came across this issue today. The default pagination value of
To change this value, maybe we could leverage the entity configs, e.g., supportsPagination or some other meta value and pass it down via the action object. |
Describe the bug
I am developing Gutenberg Plugins I found a problem. if there are more than 10 post types, it only shows me the first 10.
It's not related with "show_in_rest"
Probably it's related with: _context.abrupt but i'm not sure
To reproduce
Use this
edit: withSelect((select) => { const {getPostTypes} = select('core'); return { types: getPostTypes() }; }
Expected behavior
Return all post types
The text was updated successfully, but these errors were encountered: