WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Платформа для конвертации и монетизации трафика
функция не описана

Automattic\WooCommerce\Blocks\StoreApi\Routes

CartUpdateShipping::get_args() public WC 1.0

Get method arguments for this REST route.

{} Это метод класса: CartUpdateShipping{}

Хуков нет.

Возвращает

Массив. An array of endpoints.

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

$CartUpdateShipping = new CartUpdateShipping();
$CartUpdateShipping->get_args();

Код CartUpdateShipping::get_args() WC 4.7.1

<?php
public function get_args() {
	return [
		[
			'methods'             => \WP_REST_Server::CREATABLE,
			'callback'            => [ $this, 'get_response' ],
			'permission_callback' => '__return_true',
			'args'                => [
				'first_name' => [
					'description'       => __( 'Customer first name.', 'woocommerce' ),
					'type'              => 'string',
					'default'           => '',
					'sanitize_callback' => 'wc_clean',
					'validate_callback' => 'rest_validate_request_arg',

				],
				'last_name'  => [
					'description'       => __( 'Customer last name.', 'woocommerce' ),
					'type'              => 'string',
					'default'           => '',
					'sanitize_callback' => 'wc_clean',
					'validate_callback' => 'rest_validate_request_arg',

				],
				'address_1'  => [
					'description'       => __( 'First line of the address being shipped to.', 'woocommerce' ),
					'type'              => 'string',
					'default'           => '',
					'sanitize_callback' => 'wc_clean',
					'validate_callback' => 'rest_validate_request_arg',
				],
				'address_2'  => [
					'description'       => __( 'Second line of the address being shipped to.', 'woocommerce' ),
					'type'              => 'string',
					'default'           => '',
					'sanitize_callback' => 'wc_clean',
					'validate_callback' => 'rest_validate_request_arg',
				],
				'city'       => [
					'description'       => __( 'City of the address being shipped to.', 'woocommerce' ),
					'type'              => 'string',
					'default'           => '',
					'sanitize_callback' => 'wc_clean',
					'validate_callback' => 'rest_validate_request_arg',
				],
				'state'      => [
					'description'       => __( 'ISO code, or name, for the state, province, or district of the address being shipped to.', 'woocommerce' ),
					'type'              => 'string',
					'default'           => '',
					'sanitize_callback' => 'wc_clean',
					'validate_callback' => 'rest_validate_request_arg',
				],
				'postcode'   => [
					'description'       => __( 'Zip or Postcode of the address being shipped to.', 'woocommerce' ),
					'type'              => 'string',
					'default'           => '',
					'sanitize_callback' => 'wc_clean',
					'validate_callback' => 'rest_validate_request_arg',
				],
				'country'    => [
					'description'       => __( 'ISO code for the country of the address being shipped to.', 'woocommerce' ),
					'type'              => 'string',
					'default'           => '',
					'sanitize_callback' => 'wc_clean',
					'validate_callback' => 'rest_validate_request_arg',
				],
			],
		],
		'schema' => [ $this->schema, 'get_public_item_schema' ],
	];
}