WP_REST_Block_Pattern_Categories_Controller::get_item_schema()publicWP 6.0.0

Retrieves the block pattern category schema, conforming to JSON Schema.

{} Это метод класса: WP_REST_Block_Pattern_Categories_Controller{}

Хуков нет.

Возвращает

Массив. Item schema data.

Использование

$WP_REST_Block_Pattern_Categories_Controller = new WP_REST_Block_Pattern_Categories_Controller();
$WP_REST_Block_Pattern_Categories_Controller->get_item_schema();

Список изменений

С версии 6.0.0 Введена.

Код WP_REST_Block_Pattern_Categories_Controller::get_item_schema() WP 6.0.2

public function get_item_schema() {
	$schema = array(
		'$schema'    => 'http://json-schema.org/draft-04/schema#',
		'title'      => 'block-pattern-category',
		'type'       => 'object',
		'properties' => array(
			'name'  => array(
				'description' => __( 'The category name.' ),
				'type'        => 'string',
				'readonly'    => true,
				'context'     => array( 'view', 'edit', 'embed' ),
			),
			'label' => array(
				'description' => __( 'The category label, in human readable format.' ),
				'type'        => 'string',
				'readonly'    => true,
				'context'     => array( 'view', 'edit', 'embed' ),
			),
		),
	);

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