Title: WP_REST_View_Config_Controller::get_item_schema
Published: August 20, 2026

---

# WP_REST_View_Config_Controller::get_item_schema(): array

## In this article

 * [Return](https://developer.wordpress.org/reference/classes/wp_rest_view_config_controller/get_item_schema/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_rest_view_config_controller/get_item_schema/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_rest_view_config_controller/get_item_schema/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_rest_view_config_controller/get_item_schema/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_rest_view_config_controller/get_item_schema/?output_format=md#wp--skip-link--target)

Retrieves the item’s schema, conforming to JSON Schema.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_rest_view_config_controller/get_item_schema/?output_format=md#return)󠁿

 array Item schema data.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_rest_view_config_controller/get_item_schema/?output_format=md#source)󠁿

    ```php
    public function get_item_schema() {
    	if ( $this->schema ) {
    		return $this->add_additional_fields_schema( $this->schema );
    	}

    	$view_base_properties = $this->get_view_base_schema();

    	$this->schema = array(
    		'$schema'    => 'http://json-schema.org/draft-04/schema#',
    		'title'      => 'view-config',
    		'type'       => 'object',
    		'properties' => array(
    			'kind'            => array(
    				'description' => __( 'Entity kind.' ),
    				'type'        => 'string',
    				'readonly'    => true,
    			),
    			'name'            => array(
    				'description' => __( 'Entity name.' ),
    				'type'        => 'string',
    				'readonly'    => true,
    			),
    			'version'         => array(
    				'description' => __( 'The schema version of the configuration.' ),
    				'type'        => 'integer',
    				'readonly'    => true,
    			),
    			'default_view'    => array(
    				'description' => __( 'Default view configuration.' ),
    				'type'        => 'object',
    				'readonly'    => true,
    				'properties'  => array_merge(
    					array(
    						'type'   => array(
    							'type' => 'string',
    						),
    						'layout' => $this->get_combined_layout_schema(),
    					),
    					$view_base_properties
    				),
    			),
    			'default_layouts' => array(
    				'description' => __( 'Default layout configurations.' ),
    				'type'        => 'object',
    				'readonly'    => true,
    				'properties'  => array(
    					'table'       => array(
    						'type'       => 'object',
    						'properties' => array_merge(
    							$view_base_properties,
    							array(
    								'layout' => $this->get_table_layout_schema(),
    							)
    						),
    					),
    					'list'        => array(
    						'type'       => 'object',
    						'properties' => array_merge(
    							$view_base_properties,
    							array(
    								'layout' => $this->get_list_layout_schema(),
    							)
    						),
    					),
    					'grid'        => array(
    						'type'       => 'object',
    						'properties' => array_merge(
    							$view_base_properties,
    							array(
    								'layout' => $this->get_grid_layout_schema(),
    							)
    						),
    					),
    					'activity'    => array(
    						'type'       => 'object',
    						'properties' => array_merge(
    							$view_base_properties,
    							array(
    								'layout' => $this->get_list_layout_schema(),
    							)
    						),
    					),
    					'pickerGrid'  => array(
    						'type'       => 'object',
    						'properties' => array_merge(
    							$view_base_properties,
    							array(
    								'layout' => $this->get_grid_layout_schema(),
    							)
    						),
    					),
    					'pickerTable' => array(
    						'type'       => 'object',
    						'properties' => array_merge(
    							$view_base_properties,
    							array(
    								'layout' => $this->get_table_layout_schema(),
    							)
    						),
    					),
    				),
    			),
    			'view_list'       => array(
    				'description' => __( 'List of default views.' ),
    				'type'        => 'array',
    				'readonly'    => true,
    				'items'       => array(
    					'type'       => 'object',
    					'properties' => array(
    						'title' => array(
    							'type' => 'string',
    						),
    						'slug'  => array(
    							'type' => 'string',
    						),
    						'view'  => array(
    							'type'       => 'object',
    							'properties' => array_merge(
    								array(
    									'type'   => array(
    										'type' => 'string',
    									),
    									'layout' => $this->get_combined_layout_schema(),
    								),
    								$view_base_properties
    							),
    						),
    					),
    				),
    			),
    			'form'            => array(
    				'description' => __( 'Default form configuration.' ),
    				'type'        => 'object',
    				'readonly'    => true,
    				'properties'  => $this->get_form_schema(),
    			),
    		),
    	);

    	return $this->add_additional_fields_schema( $this->schema );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-view-config-controller.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/rest-api/endpoints/class-wp-rest-view-config-controller.php#L249)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/endpoints/class-wp-rest-view-config-controller.php#L249-L389)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_rest_view_config_controller/get_item_schema/?output_format=md#related)󠁿

| Uses | Description | 
| [WP_REST_View_Config_Controller::get_view_base_schema()](https://developer.wordpress.org/reference/classes/wp_rest_view_config_controller/get_view_base_schema/)`wp-includes/rest-api/endpoints/class-wp-rest-view-config-controller.php` |

Returns the schema properties shared by all view types (ViewBase), excluding ‘type’.

  | 
| [WP_REST_View_Config_Controller::get_combined_layout_schema()](https://developer.wordpress.org/reference/classes/wp_rest_view_config_controller/get_combined_layout_schema/)`wp-includes/rest-api/endpoints/class-wp-rest-view-config-controller.php` |

Returns a combined layout schema that accepts properties from all view types.

  | 
| [WP_REST_View_Config_Controller::get_table_layout_schema()](https://developer.wordpress.org/reference/classes/wp_rest_view_config_controller/get_table_layout_schema/)`wp-includes/rest-api/endpoints/class-wp-rest-view-config-controller.php` |

Returns the layout schema for table-type views (ViewTable, ViewPickerTable).

  | 
| [WP_REST_View_Config_Controller::get_list_layout_schema()](https://developer.wordpress.org/reference/classes/wp_rest_view_config_controller/get_list_layout_schema/)`wp-includes/rest-api/endpoints/class-wp-rest-view-config-controller.php` |

Returns the layout schema for list-type views (ViewList, ViewActivity).

  | 
| [WP_REST_View_Config_Controller::get_grid_layout_schema()](https://developer.wordpress.org/reference/classes/wp_rest_view_config_controller/get_grid_layout_schema/)`wp-includes/rest-api/endpoints/class-wp-rest-view-config-controller.php` |

Returns the layout schema for grid-type views (ViewGrid, ViewPickerGrid).

  | 
| [WP_REST_View_Config_Controller::get_form_schema()](https://developer.wordpress.org/reference/classes/wp_rest_view_config_controller/get_form_schema/)`wp-includes/rest-api/endpoints/class-wp-rest-view-config-controller.php` |

Returns the schema for the form configuration object.

  | 
| [__()](https://developer.wordpress.org/reference/functions/__/)`wp-includes/l10n.php` |

Retrieves the translation of $text.

  |

[Show 2 more](https://developer.wordpress.org/reference/classes/wp_rest_view_config_controller/get_item_schema/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/classes/wp_rest_view_config_controller/get_item_schema/?output_format=md#)

| Used by | Description | 
| [WP_REST_View_Config_Controller::get_items()](https://developer.wordpress.org/reference/classes/wp_rest_view_config_controller/get_items/)`wp-includes/rest-api/endpoints/class-wp-rest-view-config-controller.php` |

Returns the default view configuration for the given entity type.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_rest_view_config_controller/get_item_schema/?output_format=md#changelog)󠁿

| Version | Description | 
| [7.1.0](https://developer.wordpress.org/reference/since/7.1.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_rest_view_config_controller%2Fget_item_schema%2F)
before being able to contribute a note or feedback.