wppaste
WordPress

WP_REST_Global_Styles_Controller::get_item_schema(): array

Since
5.9.0
Source
wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php:455
Retrieves the global styles type' schema, conforming to JSON Schema.

Return

array
Item schema data.

Uses · 2

  • __()Retrieves the translation of $text.
  • WP_REST_Global_Styles_Controller::add_additional_fields_schema()

Source

	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'        => 'string',					'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 );	}

History

Introduced in 5.9.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 6.8.8 tag, from src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.