includes/abstracts/abstract-wc-rest-posts-controller.php 1 location
|
@@ 369-376 (lines=8) @@
|
| 366 |
|
} |
| 367 |
|
$base = add_query_arg( $request_params, rest_url( sprintf( '/%s/%s', $this->namespace, $this->rest_base ) ) ); |
| 368 |
|
|
| 369 |
|
if ( $page > 1 ) { |
| 370 |
|
$prev_page = $page - 1; |
| 371 |
|
if ( $prev_page > $max_pages ) { |
| 372 |
|
$prev_page = $max_pages; |
| 373 |
|
} |
| 374 |
|
$prev_link = add_query_arg( 'page', $prev_page, $base ); |
| 375 |
|
$response->link_header( 'prev', $prev_link ); |
| 376 |
|
} |
| 377 |
|
if ( $max_pages > $page ) { |
| 378 |
|
$next_page = $page + 1; |
| 379 |
|
$next_link = add_query_arg( 'page', $next_page, $base ); |
includes/abstracts/abstract-wc-rest-terms-controller.php 1 location
|
@@ 300-307 (lines=8) @@
|
| 297 |
|
$response->header( 'X-WP-TotalPages', (int) $max_pages ); |
| 298 |
|
|
| 299 |
|
$base = add_query_arg( $request->get_query_params(), rest_url( '/' . $this->namespace . '/' . $this->rest_base ) ); |
| 300 |
|
if ( $page > 1 ) { |
| 301 |
|
$prev_page = $page - 1; |
| 302 |
|
if ( $prev_page > $max_pages ) { |
| 303 |
|
$prev_page = $max_pages; |
| 304 |
|
} |
| 305 |
|
$prev_link = add_query_arg( 'page', $prev_page, $base ); |
| 306 |
|
$response->link_header( 'prev', $prev_link ); |
| 307 |
|
} |
| 308 |
|
if ( $max_pages > $page ) { |
| 309 |
|
$next_page = $page + 1; |
| 310 |
|
$next_link = add_query_arg( 'page', $next_page, $base ); |
includes/api/class-wc-rest-customers-controller.php 1 location
|
@@ 265-272 (lines=8) @@
|
| 262 |
|
$response->header( 'X-WP-TotalPages', (int) $max_pages ); |
| 263 |
|
|
| 264 |
|
$base = add_query_arg( $request->get_query_params(), rest_url( sprintf( '/%s/%s', $this->namespace, $this->rest_base ) ) ); |
| 265 |
|
if ( $page > 1 ) { |
| 266 |
|
$prev_page = $page - 1; |
| 267 |
|
if ( $prev_page > $max_pages ) { |
| 268 |
|
$prev_page = $max_pages; |
| 269 |
|
} |
| 270 |
|
$prev_link = add_query_arg( 'page', $prev_page, $base ); |
| 271 |
|
$response->link_header( 'prev', $prev_link ); |
| 272 |
|
} |
| 273 |
|
if ( $max_pages > $page ) { |
| 274 |
|
$next_page = $page + 1; |
| 275 |
|
$next_link = add_query_arg( 'page', $next_page, $base ); |
includes/api/class-wc-rest-taxes-controller.php 1 location
|
@@ 260-267 (lines=8) @@
|
| 257 |
|
$response->header( 'X-WP-TotalPages', (int) $max_pages ); |
| 258 |
|
|
| 259 |
|
$base = add_query_arg( $request->get_query_params(), rest_url( sprintf( '/%s/%s', $this->namespace, $this->rest_base ) ) ); |
| 260 |
|
if ( $page > 1 ) { |
| 261 |
|
$prev_page = $page - 1; |
| 262 |
|
if ( $prev_page > $max_pages ) { |
| 263 |
|
$prev_page = $max_pages; |
| 264 |
|
} |
| 265 |
|
$prev_link = add_query_arg( 'page', $prev_page, $base ); |
| 266 |
|
$response->link_header( 'prev', $prev_link ); |
| 267 |
|
} |
| 268 |
|
if ( $max_pages > $page ) { |
| 269 |
|
$next_page = $page + 1; |
| 270 |
|
$next_link = add_query_arg( 'page', $next_page, $base ); |