Automattic\WooCommerce\Internal\OrderWithdrawal
OrderWithdrawalFormView::get_template_args
Get template arguments for the order withdrawal form.
Method of the class: OrderWithdrawalFormView{}
No Hooks.
Returns
array<string,mixed>.
Usage
$OrderWithdrawalFormView = new OrderWithdrawalFormView(); $OrderWithdrawalFormView->get_template_args( $state, $form_action_url, $shop_url ): array;
- $state(OrderWithdrawalFormState) (required)
- Processed form state.
- $form_action_url(string) (required)
- Form action URL.
- $shop_url(string) (required)
- Shop URL.
Changelog
| Since 11.1.0 | Introduced. |
OrderWithdrawalFormView::get_template_args() OrderWithdrawalFormView::get template args code WC 11.3.0
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,
);
}