Automattic\WooCommerce\Internal\RestApi\Routes\V4\Orders\Schema
OrderShippingSchema::get_item_schema_properties
Return all properties for the item schema.
Note that context determines under which context data should be visible. For example, edit would be the context used when getting records with the intent of editing them. embed context allows the data to be visible when the item is being embedded in another response.
Метод класса: OrderShippingSchema{}
Хуков нет.
Возвращает
array.
Использование
$OrderShippingSchema = new OrderShippingSchema(); $OrderShippingSchema->get_item_schema_properties(): array;
Код OrderShippingSchema::get_item_schema_properties() OrderShippingSchema::get item schema properties WC 11.2.2
public function get_item_schema_properties(): array {
$schema = array(
'id' => array(
'description' => __( 'Item ID.', 'woocommerce' ),
'type' => 'integer',
'context' => self::VIEW_EDIT_EMBED_CONTEXT,
'readonly' => true,
),
'method_title' => array(
'description' => __( 'Shipping method name.', 'woocommerce' ),
'type' => 'string',
'context' => self::VIEW_EDIT_EMBED_CONTEXT,
),
'method_id' => array(
'description' => __( 'Shipping method ID.', 'woocommerce' ),
'type' => 'string',
'context' => self::VIEW_EDIT_EMBED_CONTEXT,
),
'instance_id' => array(
'description' => __( 'Shipping instance ID.', 'woocommerce' ),
'type' => 'string',
'context' => self::VIEW_EDIT_EMBED_CONTEXT,
),
'total' => array(
'description' => __( 'Line total (after discounts).', 'woocommerce' ),
'type' => 'string',
'context' => self::VIEW_EDIT_EMBED_CONTEXT,
),
'total_tax' => array(
'description' => __( 'Line total tax (after discounts).', 'woocommerce' ),
'type' => 'string',
'context' => self::VIEW_EDIT_EMBED_CONTEXT,
'readonly' => true,
),
'taxes' => $this->get_taxes_schema(),
'meta_data' => $this->get_meta_data_schema(),
'can_be_refunded' => array(
'description' => __( 'Whether the shipping line can be refunded, based on remaining refundable amount.', 'woocommerce' ),
'type' => 'boolean',
'context' => self::VIEW_EDIT_EMBED_CONTEXT,
'readonly' => true,
),
);
return $schema;
}