WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Платформа для конвертации и монетизации трафика
функция не описана

WP_REST_Block_Directory_Controller::get_item_schema() public WP 5.5.0

Retrieves the theme's schema, conforming to JSON Schema.

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

Хуков нет.

Возвращает

Массив. Item schema data.

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

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

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

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

Код WP_REST_Block_Directory_Controller::get_item_schema() WP 5.5.3

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

	$this->schema = array(
		'$schema'    => 'http://json-schema.org/draft-04/schema#',
		'title'      => 'block-directory-item',
		'type'       => 'object',
		'properties' => array(
			'name'                => array(
				'description' => __( 'The block name, in namespace/block-name format.' ),
				'type'        => 'string',
				'context'     => array( 'view' ),
			),
			'title'               => array(
				'description' => __( 'The block title, in human readable format.' ),
				'type'        => 'string',
				'context'     => array( 'view' ),
			),
			'description'         => array(
				'description' => __( 'A short description of the block, in human readable format.' ),
				'type'        => 'string',
				'context'     => array( 'view' ),
			),
			'id'                  => array(
				'description' => __( 'The block slug.' ),
				'type'        => 'string',
				'context'     => array( 'view' ),
			),
			'rating'              => array(
				'description' => __( 'The star rating of the block.' ),
				'type'        => 'integer',
				'context'     => array( 'view' ),
			),
			'rating_count'        => array(
				'description' => __( 'The number of ratings.' ),
				'type'        => 'integer',
				'context'     => array( 'view' ),
			),
			'active_installs'     => array(
				'description' => __( 'The number sites that have activated this block.' ),
				'type'        => 'string',
				'context'     => array( 'view' ),
			),
			'author_block_rating' => array(
				'description' => __( 'The average rating of blocks published by the same author.' ),
				'type'        => 'integer',
				'context'     => array( 'view' ),
			),
			'author_block_count'  => array(
				'description' => __( 'The number of blocks published by the same author.' ),
				'type'        => 'integer',
				'context'     => array( 'view' ),
			),
			'author'              => array(
				'description' => __( 'The WordPress.org username of the block author.' ),
				'type'        => 'string',
				'context'     => array( 'view' ),
			),
			'icon'                => array(
				'description' => __( 'The block icon.' ),
				'type'        => 'string',
				'format'      => 'uri',
				'context'     => array( 'view' ),
			),
			'last_updated'        => array(
				'description' => __( 'The date when the block was last updated, in fuzzy human readable format.' ),
				'type'        => 'string',
				'format'      => 'date-time',
				'context'     => array( 'view' ),
			),
			'humanized_updated'   => array(
				'description' => __( 'The date when the block was last updated, in fuzzy human readable format.' ),
				'type'        => 'string',
				'context'     => array( 'view' ),
			),
		),
	);

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