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

WP_REST_Pattern_Directory_Controller::get_item_schema() public WP 5.8.0

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

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

Хуков нет.

Возвращает

Массив. Item schema data.

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

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

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

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

Код WP_REST_Pattern_Directory_Controller::get_item_schema() WP 5.8.1

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'      => 'pattern-directory-item',
		'type'       => 'object',
		'properties' => array(
			'id'             => array(
				'description' => __( 'The pattern ID.' ),
				'type'        => 'integer',
				'minimum'     => 1,
				'context'     => array( 'view', 'embed' ),
			),

			'title'          => array(
				'description' => __( 'The pattern title, in human readable format.' ),
				'type'        => 'string',
				'minLength'   => 1,
				'context'     => array( 'view', 'embed' ),
			),

			'content'        => array(
				'description' => __( 'The pattern content.' ),
				'type'        => 'string',
				'minLength'   => 1,
				'context'     => array( 'view', 'embed' ),
			),

			'categories'     => array(
				'description' => __( "The pattern's category slugs." ),
				'type'        => 'array',
				'uniqueItems' => true,
				'items'       => array( 'type' => 'string' ),
				'context'     => array( 'view', 'embed' ),
			),

			'keywords'       => array(
				'description' => __( "The pattern's keyword slugs." ),
				'type'        => 'array',
				'uniqueItems' => true,
				'items'       => array( 'type' => 'string' ),
				'context'     => array( 'view', 'embed' ),
			),

			'description'    => array(
				'description' => __( 'A description of the pattern.' ),
				'type'        => 'string',
				'minLength'   => 1,
				'context'     => array( 'view', 'embed' ),
			),

			'viewport_width' => array(
				'description' => __( 'The preferred width of the viewport when previewing a pattern, in pixels.' ),
				'type'        => 'integer',
				'context'     => array( 'view', 'embed' ),
			),
		),
	);

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