[wp-trac] [WordPress Trac] #40510: REST API: Post Revisions: Adding support for pagination
WordPress Trac
noreply at wordpress.org
Tue Aug 28 09:34:53 UTC 2018
#40510: REST API: Post Revisions: Adding support for pagination
--------------------------------------+-----------------------
Reporter: benoitperson | Owner: flixos90
Type: enhancement | Status: assigned
Priority: normal | Milestone: 5.0
Component: REST API | Version: 4.7
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests | Focuses: rest-api
--------------------------------------+-----------------------
Changes (by flixos90):
* keywords: has-patch needs-unit-tests => has-patch has-unit-tests
Comment:
Thanks for the unit tests and improvements on this @birgire!
[attachment:"40510.4.diff"] is a minor update. The `offset` parameter
should also trigger an error if it is equal to the number of available
elements because this already means it is out of bound (contrary to page
which starts counting at 1, offset starts at 0), so I changed the `>` to
`>=`. I also switched around the order of the error checks for `offset`
and `page` and only execute the latter if `offset` is not given. Offset
takes precedence over `page`: If `offset` is present, `page` doesn't do
anything at all, so there's no point in triggering an error if `page` is
too large in such a case.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40510#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list