Merge pull request #19555 from woocommerce/update/19547-wp-cli-pagination

WP-CLI integration per_page default
This commit is contained in:
Claudio Sanches 2018-03-28 14:01:38 -03:00 committed by GitHub
commit 35b75b5beb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -206,6 +206,10 @@ class WC_CLI_REST_Command {
$method = 'GET';
}
if ( ! isset( $assoc_args['per_page'] ) || empty( $assoc_args['per_page'] ) ) {
$assoc_args['per_page'] = '100';
}
list( $status, $body, $headers ) = $this->do_request( $method, $this->get_filled_route( $args ), $assoc_args );
if ( ! empty( $assoc_args['format'] ) && 'ids' === $assoc_args['format'] ) {
$items = array_column( $body, 'id' );