| @@ 353-366 (lines=14) @@ | ||
| 350 | * @since 2.5.0 |
|
| 351 | * @subcommand list |
|
| 352 | */ |
|
| 353 | public function list_( $__, $assoc_args ) { |
|
| 354 | $query_args = $this->merge_wp_query_args( $this->get_list_query_args(), $assoc_args ); |
|
| 355 | $formatter = $this->get_formatter( $assoc_args ); |
|
| 356 | ||
| 357 | if ( 'ids' === $formatter->format ) { |
|
| 358 | $query_args['fields'] = 'ids'; |
|
| 359 | $query = new WP_Query( $query_args ); |
|
| 360 | echo implode( ' ', $query->posts ); |
|
| 361 | } else { |
|
| 362 | $query = new WP_Query( $query_args ); |
|
| 363 | $items = $this->format_posts_to_items( $query->posts ); |
|
| 364 | $formatter->display_items( $items ); |
|
| 365 | } |
|
| 366 | } |
|
| 367 | ||
| 368 | /** |
|
| 369 | * Get coupon types. |
|
| @@ 483-496 (lines=14) @@ | ||
| 480 | * @subcommand list |
|
| 481 | * @since 2.5.0 |
|
| 482 | */ |
|
| 483 | public function list_( $args, $assoc_args ) { |
|
| 484 | $query_args = $this->merge_wp_query_args( $this->get_list_query_args( $assoc_args ), $assoc_args ); |
|
| 485 | $formatter = $this->get_formatter( $assoc_args ); |
|
| 486 | ||
| 487 | if ( 'ids' === $formatter->format ) { |
|
| 488 | $query_args['fields'] = 'ids'; |
|
| 489 | $query = new WP_Query( $query_args ); |
|
| 490 | echo implode( ' ', $query->posts ); |
|
| 491 | } else { |
|
| 492 | $query = new WP_Query( $query_args ); |
|
| 493 | $items = $this->format_posts_to_items( $query->posts ); |
|
| 494 | $formatter->display_items( $items ); |
|
| 495 | } |
|
| 496 | } |
|
| 497 | ||
| 498 | /** |
|
| 499 | * List of product reviews. |
|
| @@ 370-383 (lines=14) @@ | ||
| 367 | * @subcommand list |
|
| 368 | * @since 2.5.0 |
|
| 369 | */ |
|
| 370 | public function list_( $__, $assoc_args ) { |
|
| 371 | $query_args = $this->merge_wp_user_query_args( $this->get_list_query_args(), $assoc_args ); |
|
| 372 | $formatter = $this->get_formatter( $assoc_args ); |
|
| 373 | ||
| 374 | if ( 'ids' === $formatter->format ) { |
|
| 375 | $query_args['fields'] = 'ids'; |
|
| 376 | $query = new WP_User_Query( $query_args ); |
|
| 377 | echo implode( ' ', $query->results ); |
|
| 378 | } else { |
|
| 379 | $query = new WP_User_Query( $query_args ); |
|
| 380 | $items = $this->format_users_to_items( $query->results ); |
|
| 381 | $formatter->display_items( $items ); |
|
| 382 | } |
|
| 383 | } |
|
| 384 | ||
| 385 | /** |
|
| 386 | * View customer orders. |
|
| @@ 384-397 (lines=14) @@ | ||
| 381 | * @subcommand list |
|
| 382 | * @since 2.5.0 |
|
| 383 | */ |
|
| 384 | public function list_( $args, $assoc_args ) { |
|
| 385 | $query_args = $this->merge_wp_query_args( $this->get_list_query_args( $assoc_args ), $assoc_args ); |
|
| 386 | $formatter = $this->get_formatter( $assoc_args ); |
|
| 387 | ||
| 388 | if ( 'ids' === $formatter->format ) { |
|
| 389 | $query_args['fields'] = 'ids'; |
|
| 390 | $query = new WP_Query( $query_args ); |
|
| 391 | echo implode( ' ', $query->posts ); |
|
| 392 | } else { |
|
| 393 | $query = new WP_Query( $query_args ); |
|
| 394 | $items = $this->format_posts_to_items( $query->posts ); |
|
| 395 | $formatter->display_items( $items ); |
|
| 396 | } |
|
| 397 | } |
|
| 398 | ||
| 399 | /** |
|
| 400 | * Update an order. |
|