Automattic\WooCommerce\Admin\Features\Blueprint\Steps

SetWCTaxRates::get_schema()public staticWC 1.0

Get the schema for the step.

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

Хуков нет.

Возвращает

Массив. The schema array.

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

$result = SetWCTaxRates::get_schema( $version ): array;
$version(int)
Optional version number of the schema.
По умолчанию: 1

Код SetWCTaxRates::get_schema() WC 9.7.1

public static function get_schema( $version = 1 ): array {
	return array(
		'type'       => 'object',
		'properties' => array(
			'step'   => array(
				'type' => 'string',
				'enum' => array( static::get_step_name() ),
			),
			'values' => array(
				'type'       => 'object',
				'properties' => array(
					'rates'     => array(
						'type'  => 'array',
						'items' => array(
							'type'       => 'object',
							'properties' => array(
								'tax_rate_id'       => array( 'type' => 'string' ),
								'tax_rate_country'  => array( 'type' => 'string' ),
								'tax_rate_state'    => array( 'type' => 'string' ),
								'tax_rate'          => array( 'type' => 'string' ),
								'tax_rate_name'     => array( 'type' => 'string' ),
								'tax_rate_priority' => array( 'type' => 'string' ),
								'tax_rate_compound' => array( 'type' => 'string' ),
								'tax_rate_shipping' => array( 'type' => 'string' ),
								'tax_rate_order'    => array( 'type' => 'string' ),
								'tax_rate_class'    => array( 'type' => 'string' ),
							),
							'required'   => array(
								'tax_rate_id',
								'tax_rate_country',
								'tax_rate_state',
								'tax_rate',
								'tax_rate_name',
								'tax_rate_priority',
								'tax_rate_compound',
								'tax_rate_shipping',
								'tax_rate_order',
								'tax_rate_class',
							),
						),
					),
					'locations' => array(
						'type'  => 'array',
						'items' => array(
							'type'       => 'object',
							'properties' => array(
								'location_id'   => array( 'type' => 'string' ),
								'location_code' => array( 'type' => 'string' ),
								'tax_rate_id'   => array( 'type' => 'string' ),
								'location_type' => array( 'type' => 'string' ),
							),
							'required'   => array( 'location_id', 'location_code', 'tax_rate_id', 'location_type' ),
						),
					),
				),
				'required'   => array( 'rates' ),
			),
		),
		'required'   => array( 'step', 'values' ),
	);
}