Title: WP_REST_Global_Styles_Controller::get_item_schema
Published: February 3, 2022
Last modified: May 20, 2026

---

# WP_REST_Global_Styles_Controller::get_item_schema(): array

## In this article

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

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

Retrieves the global styles type’ schema, conforming to JSON Schema.

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

 array Item schema data.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_rest_global_styles_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 );
    	}

    	$schema = array(
    		'$schema'    => 'http://json-schema.org/draft-04/schema#',
    		'title'      => $this->post_type,
    		'type'       => 'object',
    		'properties' => array(
    			'id'       => array(
    				'description' => __( 'ID of global styles config.' ),
    				'type'        => 'integer',
    				'context'     => array( 'embed', 'view', 'edit' ),
    				'readonly'    => true,
    			),
    			'styles'   => array(
    				'description' => __( 'Global styles.' ),
    				'type'        => array( 'object' ),
    				'context'     => array( 'view', 'edit' ),
    			),
    			'settings' => array(
    				'description' => __( 'Global settings.' ),
    				'type'        => array( 'object' ),
    				'context'     => array( 'view', 'edit' ),
    			),
    			'title'    => array(
    				'description' => __( 'Title of the global styles variation.' ),
    				'type'        => array( 'object', 'string' ),
    				'default'     => '',
    				'context'     => array( 'embed', 'view', 'edit' ),
    				'properties'  => array(
    					'raw'      => array(
    						'description' => __( 'Title for the global styles variation, as it exists in the database.' ),
    						'type'        => 'string',
    						'context'     => array( 'view', 'edit', 'embed' ),
    					),
    					'rendered' => array(
    						'description' => __( 'HTML title for the post, transformed for display.' ),
    						'type'        => 'string',
    						'context'     => array( 'view', 'edit', 'embed' ),
    						'readonly'    => true,
    					),
    				),
    			),
    		),
    	);

    	$this->schema = $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-global-styles-controller.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php#L461)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php#L461-L512)

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

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

Retrieves the translation of $text.

  |

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

| Version | Description | 
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.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_global_styles_controller%2Fget_item_schema%2F)
before being able to contribute a note or feedback.