[wp-trac] [WordPress Trac] #43439: &_embed only embedding first 10 categories
WordPress Trac
noreply at wordpress.org
Sun Oct 25 02:31:38 UTC 2020
#43439: &_embed only embedding first 10 categories
------------------------------------------+-----------------------------
Reporter: manyourisms | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: REST API | Version: 4.9.4
Severity: normal | Resolution:
Keywords: needs-patch needs-unit-tests | Focuses: rest-api
------------------------------------------+-----------------------------
Changes (by TimothyBlynJacobs):
* keywords: needs-patch => needs-patch needs-unit-tests
Comment:
A naive solution to this would be to always append `per_page=100` in
`WP_REST_Server::embed_links()`. However that wouldn't be ideal for single
routes, and we have no guarantee that collection routes actually implement
their `per_page` cap at `100`.
What we could do is inside of `::embed_links()` use the new
`::match_request_to_handler()` and `::respond_to_request()` methods to
reimplement `::dispatch()` but to first look if a `per_page` arg is
registered and if so, find it's `maximum` value and apply it to the
request.
@lpawlik are you interested in this one?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/43439#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list