Use new code style

This commit is contained in:
David Stone
2025-02-07 19:02:33 -07:00
parent 0181024ae1
commit 8433379d90
672 changed files with 37107 additions and 45249 deletions

View File

@ -7,40 +7,48 @@
?>
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-title',
array(
'field' => $field,
)
);
?>
?>
<?php foreach ($field->options as $option_value => $option_name) : ?>
<?php foreach ($field->options as $option_value => $option_name) : ?>
<label class="wu-block" for="field-<?php echo esc_attr($field->id); ?>-<?php echo esc_attr($option_value); ?>">
<label class="wu-block" for="field-<?php echo esc_attr($field->id); ?>-<?php echo esc_attr($option_value); ?>">
<input id="field-gateway-<?php echo esc_attr($option_value); ?>" type="checkbox" name="<?php echo esc_attr($field->id); ?>[]" value="<?php echo esc_attr($option_value); ?>" <?php echo $field->get_html_attributes(); ?> <?php checked($field->value == $option_value); ?>>
<input id="field-gateway-<?php echo esc_attr($option_value); ?>" type="checkbox" name="<?php echo esc_attr($field->id); ?>[]" value="<?php echo esc_attr($option_value); ?>" <?php echo $field->get_html_attributes(); ?> <?php checked($field->value == $option_value); ?>>
<?php echo $option_name; ?>
<?php echo $option_name; ?>
</label>
</label>
<?php endforeach; ?>
<?php endforeach; ?>
<?php
<?php
/**
* Adds the partial error template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
/**
* Adds the partial error template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-errors',
array(
'field' => $field,
)
);
?>
?>
</div>

View File

@ -7,28 +7,32 @@
?>
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<label class="wu-block wu-my-4" for="field-<?php echo esc_attr($field->id); ?>">
<label class="wu-block wu-my-4" for="field-<?php echo esc_attr($field->id); ?>">
<input id="field-<?php echo esc_attr($field->id); ?>" type="checkbox" name="<?php echo esc_attr($field->id); ?>" value="1" <?php echo $field->get_html_attributes(); ?> <?php checked($field->value); ?>>
<input id="field-<?php echo esc_attr($field->id); ?>" type="checkbox" name="<?php echo esc_attr($field->id); ?>" value="1" <?php echo $field->get_html_attributes(); ?> <?php checked($field->value); ?>>
<?php echo $field->title; ?>
<?php echo $field->title; ?>
<?php echo wu_tooltip($field->tooltip); ?>
<?php echo wu_tooltip($field->tooltip); ?>
<?php echo $field->desc; ?>
<?php echo $field->desc; ?>
</label>
</label>
<?php
<?php
/**
* Adds the partial error template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
/**
* Adds the partial error template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-errors',
array(
'field' => $field,
)
);
?>
?>
</div>

View File

@ -7,59 +7,70 @@
?>
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<span class="wu-block wu-w-full <?php echo esc_attr($field->classes); ?>">
<span class="wu-block wu-w-full <?php echo esc_attr($field->classes); ?>">
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-title',
array(
'field' => $field,
)
);
?>
?>
<?php
/**
* Instantiate the form for the order details.
*
* @since 2.0.0
*/
$form = new \WP_Ultimo\UI\Form($field->id, $field->fields, array(
'views' => 'checkout/fields',
'classes' => 'wu-flex wu-my-1',
'field_wrapper_classes' => 'wu-bg-transparent',
'wrap_tag' => 'span',
'step' => (object) array(
'classes' => '',
),
));
<?php
/**
* Instantiate the form for the order details.
*
* @since 2.0.0
*/
$form = new \WP_Ultimo\UI\Form(
$field->id,
$field->fields,
array(
'views' => 'checkout/fields',
'classes' => 'wu-flex wu-my-1',
'field_wrapper_classes' => 'wu-bg-transparent',
'wrap_tag' => 'span',
'step' => (object) array(
'classes' => '',
),
)
);
$form->render();
$form->render();
/**
* Adds the partial error template.
*
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
/**
* Adds the partial error template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-errors',
array(
'field' => $field,
)
);
?>
?>
<?php if ($field->desc) : ?>
<?php if ($field->desc) : ?>
<span class="wu-mt-2 wu-block wu-bg-gray-100 wu-rounded wu-border-solid wu-border-gray-400 wu-border-t wu-border-l wu-border-b wu-border-r wu-text-2xs wu-py-2 wu-p-2">
<span class="wu-mt-2 wu-block wu-bg-gray-100 wu-rounded wu-border-solid wu-border-gray-400 wu-border-t wu-border-l wu-border-b wu-border-r wu-text-2xs wu-py-2 wu-p-2">
<?php echo $field->desc; ?>
<?php echo $field->desc; ?>
</span>
</span>
<?php endif; ?>
</span>
</span>
</div>

View File

@ -8,15 +8,15 @@
<?php if (is_array($field->value)) : ?>
<?php foreach ($field->value as $index => $value) : ?>
<?php foreach ($field->value as $index => $value) : ?>
<input id="field-<?php echo esc_attr($field->id).'-'.esc_attr($index); ?>" name="<?php echo esc_attr($field->id); ?>[]" type="<?php echo esc_attr($field->type); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($value); ?>" <?php echo $field->get_html_attributes(); ?>>
<input id="field-<?php echo esc_attr($field->id) . '-' . esc_attr($index); ?>" name="<?php echo esc_attr($field->id); ?>[]" type="<?php echo esc_attr($field->type); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($value); ?>" <?php echo $field->get_html_attributes(); ?>>
<?php endforeach; ?>
<?php endforeach; ?>
<?php else : ?>
<input id="field-<?php echo esc_attr($field->id); ?>" name="<?php echo esc_attr($field->id); ?>" type="<?php echo esc_attr($field->type); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?>>
<input id="field-<?php echo esc_attr($field->id); ?>" name="<?php echo esc_attr($field->id); ?>" type="<?php echo esc_attr($field->type); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?>>
<?php endif; ?>
@ -24,10 +24,14 @@
/**
* Adds the partial error template.
*
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
wu_get_template(
'checkout/fields/partials/field-errors',
array(
'field' => $field,
)
);
?>

View File

@ -8,46 +8,58 @@
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<div class="wu-block wu-w-full">
<div class="wu-block wu-w-full">
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-title',
array(
'field' => $field,
)
);
/**
* Adds the partial description template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-description', array(
'field' => $field,
));
/**
* Adds the partial description template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-description',
array(
'field' => $field,
)
);
?>
?>
<div class="wu-block wu-w-full wu-mt-4">
<div class="wu-block wu-w-full wu-mt-4">
<?php echo $field->content; ?>
<?php echo $field->content; ?>
</div>
</div>
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-errors',
array(
'field' => $field,
)
);
?>
?>
</div>
</div>
</div>

View File

@ -8,6 +8,6 @@
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<?php echo $field->desc; ?>
<?php echo $field->desc; ?>
</div>

View File

@ -7,49 +7,57 @@
?>
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-title',
array(
'field' => $field,
)
);
?>
?>
<input class="form-control wu-w-full wu-my-1 <?php echo esc_attr(trim($field->classes)); ?>" id="field-<?php echo esc_attr($field->id); ?>" name="<?php echo esc_attr($field->id); ?>" type="<?php echo esc_attr($field->type); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?>>
<input class="form-control wu-w-full wu-my-1 <?php echo esc_attr(trim($field->classes)); ?>" id="field-<?php echo esc_attr($field->id); ?>" name="<?php echo esc_attr($field->id); ?>" type="<?php echo esc_attr($field->type); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?>>
<?php if ($field->meter) : ?>
<?php if ($field->meter) : ?>
<span class="wu-block">
<span class="wu-block">
<span id="pass-strength-result" class="wu-py-2 wu-px-4 wu-bg-gray-100 wu-block wu-text-sm">
<span id="pass-strength-result" class="wu-py-2 wu-px-4 wu-bg-gray-100 wu-block wu-text-sm">
<?php _e('Strength Meter', 'wp-ultimo'); ?>
<?php _e('Strength Meter', 'wp-ultimo'); ?>
</span>
</span>
</span>
</span>
<?php endif; ?>
<?php endif; ?>
<?php
<?php
/**
* Adds the partial error template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
/**
* Adds the partial error template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-errors',
array(
'field' => $field,
)
);
?>
?>
<!--
<div class="wu-border-red-300"></div>
<div class="wu-border-yellow-300"></div>
-->
<!--
<div class="wu-border-red-300"></div>
<div class="wu-border-yellow-300"></div>
-->
</div>

View File

@ -10,70 +10,79 @@ $active_gateways = wu_get_active_gateway_as_options();
?>
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" v-cloak v-show="order && order.should_collect_payment" <?php echo $field->get_wrapper_html_attributes(); ?>>
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-title',
array(
'field' => $field,
)
);
?>
?>
<?php foreach ($active_gateways as $option_value => $option_name) : ?>
<?php foreach ($active_gateways as $option_value => $option_name) : ?>
<?php if (count($active_gateways) === 1) : ?>
<?php if (count($active_gateways) === 1) : ?>
<input
id="field-gateway"
type="hidden"
name="gateway"
value="<?php echo esc_attr($option_value); ?>"
v-model="gateway"
<?php echo $field->get_html_attributes(); ?>
>
<input
id="field-gateway"
type="hidden"
name="gateway"
value="<?php echo esc_attr($option_value); ?>"
v-model="gateway"
<?php echo $field->get_html_attributes(); ?>
>
<?php else : ?>
<?php else : ?>
<label class="wu-block" for="field-<?php echo esc_attr($field->id); ?>-<?php echo esc_attr($option_value); ?>">
<label class="wu-block" for="field-<?php echo esc_attr($field->id); ?>-<?php echo esc_attr($option_value); ?>">
<input
id="field-gateway-<?php echo esc_attr($option_value); ?>"
type="radio"
name="gateway"
value="<?php echo esc_attr($option_value); ?>"
v-model="gateway"
class="<?php echo trim($field->classes); ?>"
<?php echo $field->get_html_attributes(); ?>
<?php checked($field->value == $option_value); ?>
>
<input
id="field-gateway-<?php echo esc_attr($option_value); ?>"
type="radio"
name="gateway"
value="<?php echo esc_attr($option_value); ?>"
v-model="gateway"
class="<?php echo trim($field->classes); ?>"
<?php echo $field->get_html_attributes(); ?>
<?php checked($field->value == $option_value); ?>
>
<?php echo $option_name; ?>
<?php echo $option_name; ?>
</label>
</label>
<?php endif; ?>
<?php endif; ?>
<?php endforeach; ?>
<?php endforeach; ?>
<?php
<?php
/**
* Adds the partial error template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
/**
* Adds the partial error template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-errors',
array(
'field' => $field,
)
);
/**
* Load Gateway fields
* @since 2.0.0
*/
do_action('wu_checkout_gateway_fields');
/**
* Load Gateway fields
*
* @since 2.0.0
*/
do_action('wu_checkout_gateway_fields');
?>
?>
</div>

View File

@ -7,40 +7,48 @@
?>
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-title',
array(
'field' => $field,
)
);
?>
?>
<?php foreach (wu_get_plans() as $option) : ?>
<?php foreach (wu_get_plans() as $option) : ?>
<label class="wu-block" for="field-<?php echo esc_attr($field->id); ?>-<?php echo esc_attr($option->get_id()); ?>">
<label class="wu-block" for="field-<?php echo esc_attr($field->id); ?>-<?php echo esc_attr($option->get_id()); ?>">
<input id="field-products-<?php echo esc_attr($option->get_id()); ?>" type="checkbox" name="products[]" value="<?php echo esc_attr($option->get_id()); ?>" <?php echo $field->get_html_attributes(); ?> <?php checked($field->value == $option->get_id()); ?> v-model="products">
<input id="field-products-<?php echo esc_attr($option->get_id()); ?>" type="checkbox" name="products[]" value="<?php echo esc_attr($option->get_id()); ?>" <?php echo $field->get_html_attributes(); ?> <?php checked($field->value == $option->get_id()); ?> v-model="products">
<?php echo $option->get_name(); ?>
<?php echo $option->get_name(); ?>
</label>
</label>
<?php endforeach; ?>
<?php endforeach; ?>
<?php
<?php
/**
* Adds the partial error template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
/**
* Adds the partial error template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-errors',
array(
'field' => $field,
)
);
?>
?>
</div>

View File

@ -7,40 +7,48 @@
?>
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-title',
array(
'field' => $field,
)
);
?>
?>
<?php foreach ($field->options as $option_value => $option_name) : ?>
<?php foreach ($field->options as $option_value => $option_name) : ?>
<label class="wu-block" for="field-<?php echo esc_attr($field->id); ?>-<?php echo esc_attr($option_value); ?>">
<label class="wu-block" for="field-<?php echo esc_attr($field->id); ?>-<?php echo esc_attr($option_value); ?>">
<input id="field-gateway-<?php echo esc_attr($option_value); ?>" type="radio" name="<?php echo esc_attr($field->id); ?>" value="<?php echo esc_attr($option_value); ?>" <?php echo $field->get_html_attributes(); ?> <?php checked($field->value == $option_value); ?>>
<input id="field-gateway-<?php echo esc_attr($option_value); ?>" type="radio" name="<?php echo esc_attr($field->id); ?>" value="<?php echo esc_attr($option_value); ?>" <?php echo $field->get_html_attributes(); ?> <?php checked($field->value == $option_value); ?>>
<?php echo $option_name; ?>
<?php echo $option_name; ?>
</label>
</label>
<?php endforeach; ?>
<?php endforeach; ?>
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-errors',
array(
'field' => $field,
)
);
?>
?>
</div>

View File

@ -7,61 +7,69 @@
?>
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-title',
array(
'field' => $field,
)
);
?>
?>
<select
class="form-control wu-w-full wu-my-1 <?php echo esc_attr(trim($field->classes)); ?>"
id="field-<?php echo esc_attr($field->id); ?>"
name="<?php echo esc_attr($field->id); ?>"
value="<?php echo esc_attr($field->value); ?>"
<?php echo $field->get_html_attributes(); ?>
>
<select
class="form-control wu-w-full wu-my-1 <?php echo esc_attr(trim($field->classes)); ?>"
id="field-<?php echo esc_attr($field->id); ?>"
name="<?php echo esc_attr($field->id); ?>"
value="<?php echo esc_attr($field->value); ?>"
<?php echo $field->get_html_attributes(); ?>
>
<?php if ($field->placeholder) : ?>
<?php if ($field->placeholder) : ?>
<option <?php checked(!$field->value); ?> class="wu-opacity-75"><?php echo $field->placeholder; ?></option>
<option <?php checked(! $field->value); ?> class="wu-opacity-75"><?php echo $field->placeholder; ?></option>
<?php endif; ?>
<?php endif; ?>
<?php foreach ($field->options as $key => $label) : ?>
<?php foreach ($field->options as $key => $label) : ?>
<option
value="<?php echo esc_attr($key); ?>"
<?php checked($key, $field->value); ?>
>
<?php echo $label; ?>
</option>
<option
value="<?php echo esc_attr($key); ?>"
<?php checked($key, $field->value); ?>
>
<?php echo $label; ?>
</option>
<?php endforeach; ?>
<?php endforeach; ?>
<?php if ($field->options_template) : ?>
<?php if ($field->options_template) : ?>
<?php echo $field->options_template; ?>
<?php echo $field->options_template; ?>
<?php endif; ?>
<?php endif; ?>
</select>
</select>
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-errors',
array(
'field' => $field,
)
);
?>
?>
</div>

View File

@ -7,10 +7,10 @@
?>
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<button id="<?php echo esc_attr($field->id); ?>-btn" type="submit" name="<?php echo esc_attr($field->id); ?>-btn" <?php echo $field->get_html_attributes(); ?> class="button <?php echo esc_attr(trim($field->classes)); ?>">
<button id="<?php echo esc_attr($field->id); ?>-btn" type="submit" name="<?php echo esc_attr($field->id); ?>-btn" <?php echo $field->get_html_attributes(); ?> class="button <?php echo esc_attr(trim($field->classes)); ?>">
<?php echo $field->title; ?>
<?php echo $field->title; ?>
</button>
</button>
</div>

View File

@ -7,54 +7,62 @@
?>
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-title',
array(
'field' => $field,
)
);
?>
?>
<?php if ($field->prefix) : ?>
<?php if ($field->prefix) : ?>
<div class="sm:wu-flex wu-items-stretch wu-content-center">
<div class="sm:wu-flex wu-items-stretch wu-content-center">
<div <?php echo wu_array_to_html_attrs($field->prefix_html_attr ?? array()); ?>>
<?php echo $field->prefix; ?>
</div>
<div <?php echo wu_array_to_html_attrs($field->prefix_html_attr ?? array()); ?>>
<?php echo $field->prefix; ?>
</div>
<?php endif; ?>
<?php endif; ?>
<input class="form-control wu-w-full wu-my-1 <?php echo esc_attr(trim($field->classes)); ?>" id="field-<?php echo esc_attr($field->id); ?>" name="<?php echo esc_attr($field->id); ?>" type="<?php echo esc_attr($field->type); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?>>
<input class="form-control wu-w-full wu-my-1 <?php echo esc_attr(trim($field->classes)); ?>" id="field-<?php echo esc_attr($field->id); ?>" name="<?php echo esc_attr($field->id); ?>" type="<?php echo esc_attr($field->type); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?>>
<?php if ($field->suffix) : ?>
<?php if ($field->suffix) : ?>
<div <?php echo wu_array_to_html_attrs($field->suffix_html_attr ?? array()); ?>>
<?php echo $field->suffix; ?>
</div>
<div <?php echo wu_array_to_html_attrs($field->suffix_html_attr ?? array()); ?>>
<?php echo $field->suffix; ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if ($field->prefix || $field->suffix) : ?>
<?php if ($field->prefix || $field->suffix) : ?>
</div>
</div>
<?php endif; ?>
<?php endif; ?>
<?php
<?php
/**
* Adds the partial error template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
/**
* Adds the partial error template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-errors',
array(
'field' => $field,
)
);
?>
?>
</div>

View File

@ -7,28 +7,32 @@
?>
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<label class="wu-block wu-my-4" for="field-<?php echo esc_attr($field->id); ?>">
<label class="wu-block wu-my-4" for="field-<?php echo esc_attr($field->id); ?>">
<input id="field-<?php echo esc_attr($field->id); ?>" type="checkbox" name="<?php echo esc_attr($field->id); ?>" value="1" <?php echo $field->get_html_attributes(); ?> <?php checked($field->value); ?>>
<input id="field-<?php echo esc_attr($field->id); ?>" type="checkbox" name="<?php echo esc_attr($field->id); ?>" value="1" <?php echo $field->get_html_attributes(); ?> <?php checked($field->value); ?>>
<?php echo $field->title; ?>
<?php echo $field->title; ?>
<?php echo wu_tooltip($field->tooltip); ?>
<?php echo wu_tooltip($field->tooltip); ?>
<?php echo $field->desc; ?>
<?php echo $field->desc; ?>
</label>
</label>
<?php
<?php
/**
* Adds the partial error template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
/**
* Adds the partial error template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-errors',
array(
'field' => $field,
)
);
?>
?>
</div>

View File

@ -7,28 +7,28 @@
?>
<?php if ($form->wrap_in_form_tag) : ?>
<form id="<?php echo esc_attr($form_slug); ?>" method="<?php echo esc_attr($form->method); ?>" <?php echo $form->get_html_attributes(); ?>>
<form id="<?php echo esc_attr($form_slug); ?>" method="<?php echo esc_attr($form->method); ?>" <?php echo $form->get_html_attributes(); ?>>
<?php else : ?>
<<?php echo $form->wrap_tag; ?> class="<?php echo esc_attr(trim($form->classes ? $form->classes.' '.$step->classes.' wu-mt-2' : $step->classes.' wu-mt-2')); ?>" <?php echo $form->get_html_attributes(); ?>>
<<?php echo $form->wrap_tag; ?> class="<?php echo esc_attr(trim($form->classes ? $form->classes . ' ' . $step->classes . ' wu-mt-2' : $step->classes . ' wu-mt-2')); ?>" <?php echo $form->get_html_attributes(); ?>>
<?php endif; ?>
<?php if ($form->title) : ?>
<?php if ($form->title) : ?>
<h3 class="wu-checkout-section-title"><?php echo $form->title; ?></h3>
<h3 class="wu-checkout-section-title"><?php echo $form->title; ?></h3>
<?php endif; ?>
<?php endif; ?>
<?php echo $rendered_fields; ?>
<?php echo $rendered_fields; ?>
<?php if ($form->wrap_in_form_tag) : ?>
</form>
</form>
<?php else : ?>
</<?php echo $form->wrap_tag; ?>>
</<?php echo $form->wrap_tag; ?>>
<?php endif; ?>

View File

@ -8,6 +8,7 @@
<?php if ($field->desc) : ?>
<?php echo $field->desc; ?>
<?php echo $field->desc; ?>
<?php endif; ?>
<?php
endif;

View File

@ -7,8 +7,8 @@
?>
<span
v-cloak
class="wu-block wu-bg-red-100 wu-p-2 wu-mb-4"
v-if="get_error('<?php echo esc_attr($field->id); ?>')"
v-html="get_error('<?php echo esc_attr($field->id); ?>').message"
v-cloak
class="wu-block wu-bg-red-100 wu-p-2 wu-mb-4"
v-if="get_error('<?php echo esc_attr($field->id); ?>')"
v-html="get_error('<?php echo esc_attr($field->id); ?>').message"
></span>

View File

@ -8,18 +8,18 @@
<?php if ($field->title) : ?>
<label class="wu-block" for="field-<?php echo esc_attr($field->id); ?>">
<label class="wu-block" for="field-<?php echo esc_attr($field->id); ?>">
<?php echo $field->title; ?>
<?php echo $field->title; ?>
<?php if ($field->required) : ?>
<?php if ($field->required) : ?>
<span class="wu-checkout-required-field wu-text-red-500">*</span>
<span class="wu-checkout-required-field wu-text-red-500">*</span>
<?php endif; ?>
<?php endif; ?>
<?php echo wu_tooltip($field->tooltip); ?>
<?php echo wu_tooltip($field->tooltip); ?>
</label>
</label>
<?php endif; ?>