public function image_size( $args, $assoc_args ) {
		$assoc_args = array_merge(
			array(
				'fields' => 'name,width,height,crop,ratio',
			),
			$assoc_args
		);

		$sizes = $this->get_registered_image_sizes();

		usort(
			$sizes,
			function( $a, $b ) {
				if ( $a['width'] === $b['width'] ) {
					return 0;
				}
				return ( $a['width'] < $b['width'] ) ? 1 : -1;
			}
		);
		array_unshift(
			$sizes,
			array(
				'name'   => 'full',
				'width'  => '',
				'height' => '',
				'crop'   => 'N/A',
				'ratio'  => 'N/A',
			)
		);
		WP_CLI\Utils\format_items( $assoc_args['format'], $sizes, explode( ',', $assoc_args['fields'] ) );
	}
public function image_size( $args, $assoc_args ) {
		$assoc_args = array_merge(
			array(
				'fields' => 'name,width,height,crop,ratio',
			),
			$assoc_args
		);

		$sizes = $this->get_registered_image_sizes();

		usort(
			$sizes,
			function( $a, $b ) {
				if ( $a['width'] === $b['width'] ) {
					return 0;
				}
				return ( $a['width'] < $b['width'] ) ? 1 : -1;
			}
		);
		array_unshift(
			$sizes,
			array(
				'name'   => 'full',
				'width'  => '',
				'height' => '',
				'crop'   => 'N/A',
				'ratio'  => 'N/A',
			)
		);
		WP_CLI\Utils\format_items( $assoc_args['format'], $sizes, explode( ',', $assoc_args['fields'] ) );
	}
public function image_size ( $ args , $ assoc_args ) { $ assoc_args = array_merge ( array ( 'fields' => 'name,width,height,crop,ratio' , ) , $ assoc_args ) ; $ sizes = $ this -> get_registered_image_sizes ( ) ; usort ( $ sizes , function ( $ a , $ b ) { if ( $ a [ 'width' ] === $ b [ 'width' ] ) { return 0 ; } return ( $ a [ 'width' ] < $ b [ 'width' ] ) ? 1 : - 1 ; } ) ; array_unshift ( $ sizes , array ( 'name' => 'full' , 'width' => '' , 'height' => '' , 'crop' => 'N/A' , 'ratio' => 'N/A' , ) ) ; WP_CLI \ Utils \ format_items ( $ assoc_args [ 'format' ] , $ sizes , explode ( ',' , $ assoc_args [ 'fields' ] ) ) ; }
Lists image sizes registered with WordPress.

## OPTIONS

[--fields=<fields>]
: Limit the output to specific fields. Defaults to all fields.

[--format=<format>]
: Render output in a specific format
---
default: table
options:
- table
- json
- csv
- yaml
- count
---

## AVAILABLE FIELDS

These fields will be displayed by default for each image size:
* name
* width
* height
* crop
* ratio

## EXAMPLES

# List all registered image sizes
$ wp media image-size
+---------------------------+-------+--------+-------+-------+
| name                      | width | height | crop  | ratio |
+---------------------------+-------+--------+-------+-------+
| full                      |       |        | N/A   | N/A   |
| twentyfourteen-full-width | 1038  | 576    | hard  | 173:96|
| large                     | 1024  | 1024   | soft  | N/A   |
| medium_large              | 768   | 0      | soft  | N/A   |
| medium                    | 300   | 300    | soft  | N/A   |
| thumbnail                 | 150   | 150    | hard  | 1:1   |
+---------------------------+-------+--------+-------+-------+

@subcommand image-size
Lists image sizes registered with WordPress .