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
|
@@ 246-253 (lines=8) @@
|
| 243 |
|
$response->header( 'X-WP-TotalPages', (int) $max_pages ); |
| 244 |
|
|
| 245 |
|
$base = add_query_arg( $request->get_query_params(), rest_url( sprintf( '/%s/%s', $this->namespace, $this->rest_base ) ) ); |
| 246 |
|
if ( $page > 1 ) { |
| 247 |
|
$prev_page = $page - 1; |
| 248 |
|
if ( $prev_page > $max_pages ) { |
| 249 |
|
$prev_page = $max_pages; |
| 250 |
|
} |
| 251 |
|
$prev_link = add_query_arg( 'page', $prev_page, $base ); |
| 252 |
|
$response->link_header( 'prev', $prev_link ); |
| 253 |
|
} |
| 254 |
|
if ( $max_pages > $page ) { |
| 255 |
|
$next_page = $page + 1; |
| 256 |
|
$next_link = add_query_arg( 'page', $next_page, $base ); |