Automattic\WooCommerce\Internal\OrderWithdrawal

OrderWithdrawalFormView::get_template_args │ public │ WC 11.1.0

Get template arguments for the order withdrawal form.

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

Хуков нет.

Возвращает

array<string,mixed>.

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

$OrderWithdrawalFormView = new OrderWithdrawalFormView();
$OrderWithdrawalFormView->get_template_args( $state, $form_action_url, $shop_url ): array;
$state(OrderWithdrawalFormState) (обязательный)
Processed form state.
$form_action_url(строка) (обязательный)
Form action URL.
$shop_url(строка) (обязательный)
Shop URL.

Список изменений

С версии 11.1.0 Введена.

Код OrderWithdrawalFormView::get_template_args() WC 11.2.2

public function get_template_args( OrderWithdrawalFormState $state, string $form_action_url, string $shop_url ): array {
	return array(
		'screen'                  => $state->screen,
		'data'                    => $state->data,
		'errors'                  => $state->errors,
		'fields'                  => $this->get_prepared_form_fields( $state->errors ),
		'withdrawal_type_options' => $this->get_withdrawal_type_options(),
		'hidden_fields'           => $this->get_hidden_fields( $state->data ),
		'review_rows'             => $this->get_review_rows( $state->data ),
		'nonce_action'            => OrderWithdrawalFormProcessor::NONCE_ACTION,
		'nonce_field'             => OrderWithdrawalFormProcessor::NONCE_FIELD,
		'action_field'            => OrderWithdrawalFormProcessor::ACTION_FIELD,
		'action_review'           => OrderWithdrawalFormProcessor::ACTION_REVIEW,
		'action_confirm'          => OrderWithdrawalFormProcessor::ACTION_CONFIRM,
		'action_edit'             => OrderWithdrawalFormProcessor::ACTION_EDIT,
		'form_action_url'         => $form_action_url,
		'shop_url'                => $shop_url,
	);
}