How to filter Parent Page `posts_per_page` value in Gutenberg editor
-
Hello all,
TL;DR:
I’m looking for a filter that lets me choose how many pages to request from the /pages/ endpoint of the REST API so that the “Parent Page” dropdown in Gutenberg returns an accurate representation of my CMS Pages. I’ve tried searching Core but have not found what I’m looking for. If I could simply ask it for 500 pages at once instead of 5 separate calls of 100 pages at a time, I believe my problem would be solved.Long Version:
The default behavior of the “Parent Page” dropdown in the Gutenberg editor queries 100 pages at a time, and appears to have a known bug which causes not all Pages to return in the results when you are using custommenu_order
sort values for your Pages. This issue ONLY exists in the Gutenberg editor; people are able to switch to Classic Editor and it works fine (not an option for me) and it can be sidestepped by using the Quick Edit tool (also not an ideal option, since ANY time a user edits the page they risk removing the Parent Page from the Page they are editing when this bug occurs)Trac Ticket:
– https://core.trac.www.ads-software.com/ticket/46294Gutenberg Ticket:
– https://github.com/WordPress/gutenberg/issues/9441Support Tickets referencing this issue: (first three, just to show I’m not the only one with this issue)
– https://www.ads-software.com/support/topic/parent-page-missing-in-page-attributes/
– https://www.ads-software.com/support/topic/not-all-the-parent-pages-are-available/
– https://www.ads-software.com/support/topic/duplicate-missing-pages-in-parent-page-drop-down-of-the-wordpress/I would be open to other solutions to this problem as well, but being able to query ALL my Pages at once seems to be the most expedient path to a fix since it should prevent the bug that occurs during the paginated results being mashed together to create the dropdown.
Thanks in advance!
- The topic ‘How to filter Parent Page `posts_per_page` value in Gutenberg editor’ is closed to new replies.