add prev
This commit is contained in:
parent
4b8ffc874a
commit
7f3d31c59e
1 changed files with 5 additions and 1 deletions
|
@ -80,10 +80,14 @@ class Followers {
|
|||
$json->first = \add_query_arg( 'page', 1, $json->partOf ); // phpcs:ignore
|
||||
$json->last = \add_query_arg( 'page', \ceil ( $json->totalItems / 20 ), $json->partOf ); // phpcs:ignore
|
||||
|
||||
if ( $page && ( ( \ceil ( $json->totalItems / 20 ) ) >= $page ) ) { // phpcs:ignore
|
||||
if ( $page && ( ( \ceil ( $json->totalItems / 20 ) ) > $page ) ) { // phpcs:ignore
|
||||
$json->next = \add_query_arg( 'page', $page + 1, $json->partOf ); // phpcs:ignore
|
||||
}
|
||||
|
||||
if ( $page && ( $page > 1 ) ) { // phpcs:ignore
|
||||
$json->prev = \add_query_arg( 'page', $page - 1, $json->partOf ); // phpcs:ignore
|
||||
}
|
||||
|
||||
// phpcs:ignore
|
||||
$json->orderedItems = array_map(
|
||||
function( $item ) {
|
||||
|
|
Loading…
Reference in a new issue