public function get( $args, $assoc_args ) {
		$theme = $this->fetcher->get_check( $args[0] );

		$errors = $theme->errors();
		if ( is_wp_error( $errors ) ) {
			$message = $errors->get_error_message();
			WP_CLI::error( $message );
		}

		// WP_Theme object employs magic getter, unfortunately
		$theme_vars = [
			'name',
			'title',
			'version',
			'parent_theme',
			'template_dir',
			'stylesheet_dir',
			'template',
			'stylesheet',
			'screenshot',
			'description',
			'author',
			'tags',
			'theme_root',
			'theme_root_uri',
		];
		$theme_obj  = new stdClass();
		foreach ( $theme_vars as $var ) {
			$theme_obj->$var = $theme->$var;
		}

		$theme_obj->description = wordwrap( $theme_obj->description );

		if ( empty( $assoc_args['fields'] ) ) {
			$assoc_args['fields'] = $theme_vars;
		}

		$formatter = $this->get_formatter( $assoc_args );
		$formatter->display_item( $theme_obj );
	}
public function get( $args, $assoc_args ) {
		$theme = $this->fetcher->get_check( $args[0] );

		$errors = $theme->errors();
		if ( is_wp_error( $errors ) ) {
			$message = $errors->get_error_message();
			WP_CLI::error( $message );
		}

		// WP_Theme object employs magic getter, unfortunately
		$theme_vars = [
			'name',
			'title',
			'version',
			'parent_theme',
			'template_dir',
			'stylesheet_dir',
			'template',
			'stylesheet',
			'screenshot',
			'description',
			'author',
			'tags',
			'theme_root',
			'theme_root_uri',
		];
		$theme_obj  = new stdClass();
		foreach ( $theme_vars as $var ) {
			$theme_obj->$var = $theme->$var;
		}

		$theme_obj->description = wordwrap( $theme_obj->description );

		if ( empty( $assoc_args['fields'] ) ) {
			$assoc_args['fields'] = $theme_vars;
		}

		$formatter = $this->get_formatter( $assoc_args );
		$formatter->display_item( $theme_obj );
	}
public function get ( $ args , $ assoc_args ) { $ theme = $ this -> fetcher -> get_check ( $ args [ 0 ] ) ; $ errors = $ theme -> errors ( ) ; if ( is_wp_error ( $ errors ) ) { $ message = $ errors -> get_error_message ( ) ; WP_CLI :: error ( $ message ) ; } // WP_Theme object employs magic getter, unfortunately $ theme_vars = [ 'name' , 'title' , 'version' , 'parent_theme' , 'template_dir' , 'stylesheet_dir' , 'template' , 'stylesheet' , 'screenshot' , 'description' , 'author' , 'tags' , 'theme_root' , 'theme_root_uri' , ] ; $ theme_obj = new stdClass ( ) ; foreach ( $ theme_vars as $ var ) { $ theme_obj -> $ var = $ theme -> $ var ; } $ theme_obj -> description = wordwrap ( $ theme_obj -> description ) ; if ( empty ( $ assoc_args [ 'fields' ] ) ) { $ assoc_args [ 'fields' ] = $ theme_vars ; } $ formatter = $ this -> get_formatter ( $ assoc_args ) ; $ formatter -> display_item ( $ theme_obj ) ; }
Gets details about a theme.

## OPTIONS

<theme>
: The theme to get.

[--field=<field>]
: Instead of returning the whole theme, returns the value of a single field.

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

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

## EXAMPLES

$ wp theme get twentysixteen --fields=name,title,version
+---------+----------------+
| Field   | Value          |
+---------+----------------+
| name    | Twenty Sixteen |
| title   | Twenty Sixteen |
| version | 1.2            |
+---------+----------------+
Gets details about a theme .