re-enable default pagination in API if "limit" is not specified
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-05-22 19:06:24 +02:00
parent 2a228fc39c
commit 2cc277638f
2 changed files with 24 additions and 6 deletions

View File

@ -64,13 +64,15 @@ class Api {
);
}
if ( ! empty( $limit ) && $limit > 0 ) {
if ( $limit > 0 ) {
$args['posts_per_page'] = $limit;
} else {
$args['paged'] = 1;
} elseif ( $limit < 0 ) {
$args['nopaging'] = true;
$args['paged'] = 0;
}
if ( $last_poll > 0 ) {
if ( ! empty( $last_poll ) ) {
$last_poll = explode(
',',
gmdate(