WC_REST_Order_Refunds_Controller::get_item_schema()publicWC 1.0

Get the refund schema, conforming to JSON Schema.

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

Хуков нет.

Возвращает

Массив.

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

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

Код WC_REST_Order_Refunds_Controller::get_item_schema() WC 8.7.0

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

	$schema['properties']['line_items']['items']['properties']['refund_total'] = array(
		'description' => __( 'Amount that will be refunded for this line item (excluding taxes).', 'woocommerce' ),
		'type'        => 'number',
		'context'     => array( 'edit' ),
		'readonly'    => true,
	);

	$schema['properties']['line_items']['items']['properties']['taxes']['items']['properties']['refund_total'] = array(
		'description' => __( 'Amount that will be refunded for this tax.', 'woocommerce' ),
		'type'        => 'number',
		'context'     => array( 'edit' ),
		'readonly'    => true,
	);

	$schema['properties']['api_restock'] = array(
		'description' => __( 'When true, refunded items are restocked.', 'woocommerce' ),
		'type'        => 'boolean',
		'context'     => array( 'edit' ),
		'default'     => true,
	);

	return $schema;
}