Automattic\WooCommerce\StoreApi\Routes\V1

Batch::get_args()publicWC 1.0

Get arguments for this REST route.

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

Хуков нет.

Возвращает

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

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

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

Код Batch::get_args() WC 8.7.0

public function get_args() {
	return array(
		'callback'            => [ $this, 'get_response' ],
		'methods'             => 'POST',
		'permission_callback' => '__return_true',
		'args'                => array(
			'validation' => array(
				'type'    => 'string',
				'enum'    => array( 'require-all-validate', 'normal' ),
				'default' => 'normal',
			),
			'requests'   => array(
				'required' => true,
				'type'     => 'array',
				'maxItems' => 25,
				'items'    => array(
					'type'       => 'object',
					'properties' => array(
						'method'  => array(
							'type'    => 'string',
							'enum'    => array( 'POST', 'PUT', 'PATCH', 'DELETE' ),
							'default' => 'POST',
						),
						'path'    => array(
							'type'     => 'string',
							'required' => true,
						),
						'body'    => array(
							'type'                 => 'object',
							'properties'           => array(),
							'additionalProperties' => true,
						),
						'headers' => array(
							'type'                 => 'object',
							'properties'           => array(),
							'additionalProperties' => array(
								'type'  => array( 'string', 'array' ),
								'items' => array(
									'type' => 'string',
								),
							),
						),
					),
				),
			),
		),
	);
}