Automattic\WooCommerce\StoreApi\Routes\V1\Ucp

CatalogProduct::get_request_args │ protected │ WC 1.0

Request body arguments accepted by this route.

id is deliberately not marked required: a missing id answers with the UCP VALIDATION_ERROR envelope rather than rest_missing_callback_param.

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

Хуков нет.

Возвращает

array.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_request_args(): array;

Код CatalogProduct::get_request_args() WC 11.3.0

protected function get_request_args(): array {
	return array_merge(
		parent::get_request_args(),
		array(
			'id'       => array(
				'description' => __( 'Product or variant identifier.', 'woocommerce' ),
				'type'        => array( 'string', 'integer' ),
			),
			'selected' => array(
				'description' => __( 'Option selections used to narrow the returned variants.', 'woocommerce' ),
				'type'        => 'array',
			),
		)
	);
}