WC_REST_Settings_V2_Controller::get_item_schema()publicWC 3.0.0

Get the groups schema, conforming to JSON Schema.

Метод класса: WC_REST_Settings_V2_Controller{}

Хуков нет.

Возвращает

Массив.

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

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

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

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

Код WC_REST_Settings_V2_Controller::get_item_schema() WC 8.7.0

public function get_item_schema() {
	$schema = array(
		'$schema'    => 'http://json-schema.org/draft-04/schema#',
		'title'      => 'setting_group',
		'type'       => 'object',
		'properties' => array(
			'id'          => array(
				'description' => __( 'A unique identifier that can be used to link settings together.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'view' ),
				'readonly'    => true,
			),
			'label'       => array(
				'description' => __( 'A human readable label for the setting used in interfaces.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'view' ),
				'readonly'    => true,
			),
			'description' => array(
				'description' => __( 'A human readable description for the setting used in interfaces.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'view' ),
				'readonly'    => true,
			),
			'parent_id'   => array(
				'description' => __( 'ID of parent grouping.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'view' ),
				'readonly'    => true,
			),
			'sub_groups'  => array(
				'description' => __( 'IDs for settings sub groups.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'view' ),
				'readonly'    => true,
			),
		),
	);

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