WC_REST_Orders_Controller::get_item_schemapublicWC 1.0

Get the Order's schema, conforming to JSON Schema.

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

Хуков нет.

Возвращает

Массив.

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

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

Код WC_REST_Orders_Controller::get_item_schema() WC 9.9.5

public function get_item_schema() {
	$schema = parent::get_item_schema();

	$schema['properties']['created_via']['readonly'] = false;

	$schema['properties']['coupon_lines']['items']['properties']['discount']['readonly'] = true;

	$schema['properties']['manual_update'] = array(
		'default'     => false,
		'description' => __( 'Set the action as manual so that the order note registers as "added by user".', 'woocommerce' ),
		'type'        => 'boolean',
		'context'     => array( 'edit' ),
	);

	if ( $this->cogs_is_enabled() ) {
		$schema = $this->add_cogs_related_schema( $schema );
	}

	return $schema;
}