public function list_( $args, $assoc_args ) {
		// Get all entry types.
		$entry_types = papi_get_all_entry_types();

		if ( empty( $entry_types ) ) {
			WP_CLI::error( 'No Papi types exists.' );
		}

		// Create type item with the fields that
		// will be displayed.
		$entry_types = array_map( function( $entry_type ) {
			return [
				'id'              => $entry_type->get_id(),
				'name'            => $entry_type->name,
				'meta type value' => $this->get_meta_type_value( $entry_type ),
				'template'        => empty( $entry_type->template ) ? 'n/a' : $entry_type->template,
				'type'            => $entry_type->get_type(),
				'db count'        => $entry_type->get_type() === 'option' ? 'n/a' : papi_get_entry_type_count( $entry_type )
			];
		}, $entry_types );

		// Render types as a table.
		$formatter = $this->get_formatter( $assoc_args );
		$formatter->display_items( $entry_types );
	}
public function list_( $args, $assoc_args ) {
		// Get all entry types.
		$entry_types = papi_get_all_entry_types();

		if ( empty( $entry_types ) ) {
			WP_CLI::error( 'No Papi types exists.' );
		}

		// Create type item with the fields that
		// will be displayed.
		$entry_types = array_map( function( $entry_type ) {
			return [
				'id'              => $entry_type->get_id(),
				'name'            => $entry_type->name,
				'meta type value' => $this->get_meta_type_value( $entry_type ),
				'template'        => empty( $entry_type->template ) ? 'n/a' : $entry_type->template,
				'type'            => $entry_type->get_type(),
				'db count'        => $entry_type->get_type() === 'option' ? 'n/a' : papi_get_entry_type_count( $entry_type )
			];
		}, $entry_types );

		// Render types as a table.
		$formatter = $this->get_formatter( $assoc_args );
		$formatter->display_items( $entry_types );
	}
public function list_ ( $ args , $ assoc_args ) { // Get all entry types. $ entry_types = papi_get_all_entry_types ( ) ; if ( empty ( $ entry_types ) ) { WP_CLI :: error ( 'No Papi types exists.' ) ; } // Create type item with the fields that // will be displayed. $ entry_types = array_map ( function ( $ entry_type ) { return [ 'id' => $ entry_type -> get_id ( ) , 'name' => $ entry_type -> name , 'meta type value' => $ this -> get_meta_type_value ( $ entry_type ) , 'template' => empty ( $ entry_type -> template ) ? 'n/a' : $ entry_type -> template , 'type' => $ entry_type -> get_type ( ) , 'db count' => $ entry_type -> get_type ( ) === 'option' ? 'n/a' : papi_get_entry_type_count ( $ entry_type ) ] ; } , $ entry_types ) ; // Render types as a table. $ formatter = $ this -> get_formatter ( $ assoc_args ) ; $ formatter -> display_items ( $ entry_types ) ; }
List Papi types.

## Options

[--<field>=<value>]
: Filter types based on type property.

[--field=<field>]
: Prints the value of a single field for each type.

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

[--format=<format>]
: Acceptec values: table, csv, json, count, ids. Default: table.

## AVAILABLE FIELDS

These fields will be displayed by default for each type:

* name
* id
* post_type
* template
* number_of_pages
* type

Not all fields exists on a Papi type so some fields will have `n/a`
as value when no value can be displayed.

## EXAMPLES

wp papi type list

@subcommand list
List Papi types .