When no per_page is defined for list wp-cli command default to displaying all items as per the wp-cli standard.

This commit is contained in:
Gerhard Potgieter 2018-03-28 09:47:15 +02:00
parent cdb8cf86af
commit 1f2468ca3e
1 changed files with 4 additions and 0 deletions

View File

@ -223,6 +223,10 @@ class WC_CLI_REST_Command {
$assoc_args['format'] = 'table';
}
if ( empty( $assoc_args['per_page'] ) ) {
$assoc_args['per_page'] = '-1';
}
if ( ! empty( $assoc_args['format'] ) && 'count' === $assoc_args['format'] ) {
echo (int) $headers['X-WP-Total'];
} elseif ( 'headers' === $assoc_args['format'] ) {