Prep Plugin for release on WordPress.org
Escape everything that should be escaped. Add nonce checks where needed. Sanitize all inputs. Apply Code style changes across the codebase. Correct many deprecation notices. Optimize load order of many filters.
This commit is contained in:
@ -5,10 +5,9 @@
|
||||
* @since 2.0.0
|
||||
*/
|
||||
?>
|
||||
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
|
||||
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Adds the partial title template.
|
||||
*
|
||||
@ -20,23 +19,16 @@
|
||||
'field' => $field,
|
||||
]
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
<?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); ?>">
|
||||
|
||||
<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; ?>
|
||||
|
||||
</label>
|
||||
|
||||
<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(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> <?php checked(in_array($option_value, (array) $field->value, true)); ?>>
|
||||
<?php echo esc_html($option_name); ?>
|
||||
</label>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Adds the partial error template.
|
||||
*
|
||||
@ -48,7 +40,6 @@
|
||||
'field' => $field,
|
||||
]
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
@ -5,22 +5,18 @@
|
||||
* @since 2.0.0
|
||||
*/
|
||||
?>
|
||||
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
|
||||
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
|
||||
<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); ?>>
|
||||
<?php echo $field->title; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
|
||||
<?php echo $field->title; ?>
|
||||
|
||||
<?php echo wu_tooltip($field->tooltip); ?>
|
||||
|
||||
<?php echo $field->desc; ?>
|
||||
<?php echo wu_tooltip($field->tooltip); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
|
||||
<?php echo $field->desc; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</label>
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Adds the partial error template.
|
||||
*
|
||||
@ -32,7 +28,5 @@
|
||||
'field' => $field,
|
||||
]
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
@ -5,72 +5,57 @@
|
||||
* @since 2.0.0
|
||||
*/
|
||||
?>
|
||||
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
|
||||
|
||||
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<span class="wu-block wu-w-full <?php echo esc_attr($field->classes); ?>">
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Adds the partial title template.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
wu_get_template(
|
||||
'checkout/fields/partials/field-title',
|
||||
[
|
||||
'field' => $field,
|
||||
]
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Instantiate the form for the order details.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
$form = new \WP_Ultimo\UI\Form(
|
||||
$field->id,
|
||||
$field->fields,
|
||||
[
|
||||
'views' => 'checkout/fields',
|
||||
'classes' => 'wu-flex wu-my-1',
|
||||
'field_wrapper_classes' => 'wu-bg-transparent',
|
||||
'wrap_tag' => 'span',
|
||||
'step' => (object) [
|
||||
'classes' => '',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$form->render();
|
||||
|
||||
/**
|
||||
* Adds the partial error template.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
wu_get_template(
|
||||
'checkout/fields/partials/field-errors',
|
||||
[
|
||||
'field' => $field,
|
||||
]
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
<?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">
|
||||
|
||||
<?php echo $field->desc; ?>
|
||||
|
||||
</span>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Adds the partial title template.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
wu_get_template(
|
||||
'checkout/fields/partials/field-title',
|
||||
[
|
||||
'field' => $field,
|
||||
]
|
||||
);
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* Instantiate the form for the order details.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
$form = new \WP_Ultimo\UI\Form(
|
||||
$field->id,
|
||||
$field->fields,
|
||||
[
|
||||
'views' => 'checkout/fields',
|
||||
'classes' => 'wu-flex wu-my-1',
|
||||
'field_wrapper_classes' => 'wu-bg-transparent',
|
||||
'wrap_tag' => 'span',
|
||||
'step' => (object) [
|
||||
'classes' => '',
|
||||
],
|
||||
]
|
||||
);
|
||||
$form->render();
|
||||
/**
|
||||
* Adds the partial error template.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
wu_get_template(
|
||||
'checkout/fields/partials/field-errors',
|
||||
[
|
||||
'field' => $field,
|
||||
]
|
||||
);
|
||||
?>
|
||||
<?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">
|
||||
<?php echo esc_html($field->desc); ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
@ -1,27 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* Hidden field view.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php if (is_array($field->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 . '-' . $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(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<?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(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Adds the partial error template.
|
||||
*
|
||||
@ -33,5 +18,4 @@ wu_get_template(
|
||||
'field' => $field,
|
||||
]
|
||||
);
|
||||
|
||||
?>
|
||||
|
@ -6,7 +6,7 @@
|
||||
*/
|
||||
?>
|
||||
|
||||
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
|
||||
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
|
||||
<div class="wu-block wu-w-full">
|
||||
|
||||
@ -24,41 +24,31 @@
|
||||
]
|
||||
);
|
||||
|
||||
/**
|
||||
* Adds the partial description template.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
wu_get_template(
|
||||
'checkout/fields/partials/field-description',
|
||||
[
|
||||
'field' => $field,
|
||||
]
|
||||
);
|
||||
/**
|
||||
* Adds the partial description template.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
wu_get_template(
|
||||
'checkout/fields/partials/field-description',
|
||||
[
|
||||
'field' => $field,
|
||||
]
|
||||
);
|
||||
|
||||
?>
|
||||
/**
|
||||
* Adds the partial errors template.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
wu_get_template(
|
||||
'checkout/fields/partials/field-errors',
|
||||
[
|
||||
'field' => $field,
|
||||
]
|
||||
);
|
||||
|
||||
<div class="wu-block wu-w-full wu-mt-4">
|
||||
|
||||
<?php echo $field->content; ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Adds the partial title template.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
wu_get_template(
|
||||
'checkout/fields/partials/field-errors',
|
||||
[
|
||||
'field' => $field,
|
||||
]
|
||||
);
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
|
@ -6,8 +6,8 @@
|
||||
*/
|
||||
?>
|
||||
|
||||
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
|
||||
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
|
||||
<?php echo $field->desc; ?>
|
||||
<?php echo $field->desc; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
|
||||
</div>
|
||||
|
@ -5,10 +5,9 @@
|
||||
* @since 2.0.0
|
||||
*/
|
||||
?>
|
||||
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
|
||||
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Adds the partial title template.
|
||||
*
|
||||
@ -20,27 +19,24 @@
|
||||
'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(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
|
||||
<?php if ($field->meter) : ?>
|
||||
|
||||
<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">
|
||||
|
||||
<?php _e('Strength Meter', 'wp-multisite-waas'); ?>
|
||||
|
||||
<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">
|
||||
<?php esc_html_e('Strength Meter', 'wp-multisite-waas'); ?>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
</span>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Adds the partial error template.
|
||||
*
|
||||
@ -52,12 +48,6 @@
|
||||
'field' => $field,
|
||||
]
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
<!--
|
||||
<div class="wu-border-red-300"></div>
|
||||
<div class="wu-border-yellow-300"></div>
|
||||
-->
|
||||
|
||||
</div>
|
||||
|
@ -8,7 +8,7 @@
|
||||
$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(); ?>>
|
||||
<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(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
|
||||
<?php
|
||||
|
||||
@ -30,35 +30,35 @@ $active_gateways = wu_get_active_gateway_as_options();
|
||||
|
||||
<?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(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
>
|
||||
|
||||
<?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 esc_attr(trim($field->classes)); ?>"
|
||||
<?php echo $field->get_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<?php checked((string) $field->value === (string) $option_value, true); ?>
|
||||
>
|
||||
|
||||
<?php echo $option_name; ?>
|
||||
<?php echo esc_html($option_name); ?>
|
||||
|
||||
</label>
|
||||
</label>
|
||||
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
@ -78,7 +78,7 @@ $active_gateways = wu_get_active_gateway_as_options();
|
||||
|
||||
/**
|
||||
* Load Gateway fields
|
||||
*
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
do_action('wu_checkout_gateway_fields');
|
||||
|
@ -5,10 +5,9 @@
|
||||
* @since 2.0.0
|
||||
*/
|
||||
?>
|
||||
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
|
||||
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Adds the partial title template.
|
||||
*
|
||||
@ -20,23 +19,16 @@
|
||||
'field' => $field,
|
||||
]
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
<?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()); ?>">
|
||||
|
||||
<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($option->get_id() == $field->value); ?> v-model="products">
|
||||
|
||||
<?php echo $option->get_name(); ?>
|
||||
|
||||
</label>
|
||||
|
||||
<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 checked($option->get_id() == $field->value); ?> v-model="products">
|
||||
<?php echo esc_html($option->get_name()); ?>
|
||||
</label>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Adds the partial error template.
|
||||
*
|
||||
@ -48,7 +40,5 @@
|
||||
'field' => $field,
|
||||
]
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
@ -5,10 +5,9 @@
|
||||
* @since 2.0.0
|
||||
*/
|
||||
?>
|
||||
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
|
||||
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Adds the partial title template.
|
||||
*
|
||||
@ -20,23 +19,16 @@
|
||||
'field' => $field,
|
||||
]
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
<?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); ?>">
|
||||
|
||||
<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; ?>
|
||||
|
||||
</label>
|
||||
|
||||
<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); ?>>
|
||||
<?php echo esc_html($option_name); ?>
|
||||
</label>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Adds the partial title template.
|
||||
*
|
||||
@ -48,7 +40,6 @@
|
||||
'field' => $field,
|
||||
]
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
@ -5,7 +5,7 @@
|
||||
* @since 2.0.0
|
||||
*/
|
||||
?>
|
||||
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
|
||||
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
|
||||
<?php
|
||||
|
||||
@ -28,12 +28,12 @@
|
||||
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 echo $field->get_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
>
|
||||
|
||||
<?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 esc_html($field->placeholder); ?></option>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
@ -43,14 +43,14 @@
|
||||
value="<?php echo esc_attr($key); ?>"
|
||||
<?php checked($key, $field->value); ?>
|
||||
>
|
||||
<?php echo $label; ?>
|
||||
<?php echo esc_html($label); ?>
|
||||
</option>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php if ($field->options_template) : ?>
|
||||
|
||||
<?php echo $field->options_template; ?>
|
||||
<?php echo $field->options_template; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
|
@ -5,12 +5,8 @@
|
||||
* @since 2.0.0
|
||||
*/
|
||||
?>
|
||||
<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)); ?>">
|
||||
|
||||
<?php echo $field->title; ?>
|
||||
|
||||
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<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(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> class="button <?php echo esc_attr(trim($field->classes)); ?>">
|
||||
<?php echo $field->title; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
@ -5,7 +5,7 @@
|
||||
* @since 2.0.0
|
||||
*/
|
||||
?>
|
||||
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
|
||||
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
|
||||
<?php
|
||||
|
||||
@ -27,27 +27,27 @@
|
||||
|
||||
<div class="sm:wu-flex wu-items-stretch wu-content-center">
|
||||
|
||||
<div <?php echo wu_array_to_html_attrs($field->prefix_html_attr ?? []); ?>>
|
||||
<?php echo $field->prefix; ?>
|
||||
<div <?php echo wu_array_to_html_attrs($field->prefix_html_attr ?? []); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<?php echo $field->prefix; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</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(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
|
||||
<?php if ($field->suffix) : ?>
|
||||
<?php if ($field->suffix) : ?>
|
||||
|
||||
<div <?php echo wu_array_to_html_attrs($field->suffix_html_attr ?? []); ?>>
|
||||
<?php echo $field->suffix; ?>
|
||||
</div>
|
||||
<div <?php echo wu_array_to_html_attrs($field->suffix_html_attr ?? []); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<?php echo $field->suffix; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($field->prefix || $field->suffix) : ?>
|
||||
<?php if ($field->prefix || $field->suffix) : ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
|
||||
|
@ -5,22 +5,18 @@
|
||||
* @since 2.0.0
|
||||
*/
|
||||
?>
|
||||
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
|
||||
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
|
||||
<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); ?>>
|
||||
<?php echo $field->title; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
|
||||
<?php echo $field->title; ?>
|
||||
|
||||
<?php echo wu_tooltip($field->tooltip); ?>
|
||||
|
||||
<?php echo $field->desc; ?>
|
||||
<?php echo wu_tooltip($field->tooltip); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
|
||||
<?php echo $field->desc; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</label>
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Adds the partial error template.
|
||||
*
|
||||
@ -32,7 +28,5 @@
|
||||
'field' => $field,
|
||||
]
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
@ -7,21 +7,21 @@
|
||||
?>
|
||||
<?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(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
|
||||
<?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(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($form->title) : ?>
|
||||
|
||||
<h3 class="wu-checkout-section-title"><?php echo $form->title; ?></h3>
|
||||
<h3 class="wu-checkout-section-title"><?php echo esc_html($form->title); ?></h3>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php echo $rendered_fields; ?>
|
||||
<?php echo $rendered_fields; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
|
||||
<?php if ($form->wrap_in_form_tag) : ?>
|
||||
|
||||
@ -29,6 +29,6 @@
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
</<?php echo $form->wrap_tag; ?>>
|
||||
</<?php echo $form->wrap_tag; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
|
||||
<?php endif; ?>
|
||||
|
@ -9,60 +9,33 @@
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @param array $products List of product objects.
|
||||
* @param string $name ID of the field.
|
||||
* @param string $label The field label.
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php if (empty($products)) : ?>
|
||||
|
||||
<div class="wu-text-center wu-bg-gray-100 wu-rounded wu-uppercase wu-font-semibold wu-text-xs wu-text-gray-700 wu-p-4">
|
||||
|
||||
<?php _e('No Products Found.', 'wp-multisite-waas'); ?>
|
||||
|
||||
<?php esc_html_e('No Products Found.', 'wp-multisite-waas'); ?>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="wu-flex wu-mb-4 wu--mx-2">
|
||||
|
||||
<?php foreach ($products as $product) : ?>
|
||||
|
||||
<div
|
||||
class="<?php echo "wu-product-{$product->get_id()}"; ?> wu-bg-gray-100 wu-m-2 wu-px-4 wu-py-4 wu-border wu-border-solid wu-rounded wu-border-gray-400 wu-box-border wu-flex-1 wu-flex wu-flex-col wu-justify-end"
|
||||
>
|
||||
|
||||
<div class="wu-self-start">
|
||||
|
||||
<span class="wu-font-bold wu-block wu-text-xl"><?php echo $product->get_name(); ?></span>
|
||||
<span class="wu-block wu-font-semibold"><?php echo $product->get_price_description(false); ?></span>
|
||||
|
||||
<div class="<?php echo esc_attr('wu-product-' . $product->get_id()); ?> wu-bg-gray-100 wu-m-2 wu-px-4 wu-py-4 wu-border wu-border-solid wu-rounded wu-border-gray-400 wu-box-border wu-flex-1 wu-flex wu-flex-col wu-justify-end">
|
||||
<div class="wu-self-start">
|
||||
<span class="wu-font-bold wu-block wu-text-xl"><?php echo esc_html($product->get_name()); ?></span>
|
||||
<span class="wu-block wu-font-semibold"><?php echo esc_html($product->get_price_description(false)); ?></span>
|
||||
</div>
|
||||
<div class="wu-my-4">
|
||||
<ul class="wu-m-0 wu-list-none">
|
||||
<?php foreach ($product->get_pricing_table_lines() as $key => $line) : ?>
|
||||
<li class="<?php echo esc_attr(str_replace('_', '-', $key)); ?>"><?php echo esc_html($line); ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="wu-relative">
|
||||
<a href="#wu-checkout-add-<?php echo esc_attr($product->get_slug()); ?>" class="button btn wu-w-full wu-text-center wu-inline-block"><?php esc_html_e('Select', 'wp-multisite-waas'); ?></a>
|
||||
</div>
|
||||
<input type="checkbox" style="display: none;" name="products[]" value="<?php echo esc_attr($product->get_slug()); ?>" v-model="products">
|
||||
</div>
|
||||
|
||||
<div class="wu-my-4">
|
||||
|
||||
<ul class="wu-m-0 wu-list-none">
|
||||
<?php foreach ($product->get_pricing_table_lines() as $key => $line) : ?>
|
||||
|
||||
<li class="<?php echo str_replace('_', '-', $key); ?>"><?php echo $line; ?></li>
|
||||
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="wu-relative">
|
||||
|
||||
<a href="#wu-checkout-add-<?php echo $product->get_slug(); ?>" class="button btn wu-w-full wu-text-center wu-inline-block">
|
||||
<?php _e('Select', 'wp-multisite-waas'); ?>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
<input type="checkbox" style="display: none;" name="products[]" value="<?php echo $product->get_slug(); ?>" v-model="products">
|
||||
|
||||
</div>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
</div>
|
||||
|
@ -15,7 +15,7 @@ if ($is_trial_setup) {
|
||||
$date = wp_date(get_option('date_format'), strtotime($membership->get_date_trial_end(), wu_get_current_time('timestamp', true)));
|
||||
|
||||
$notes[] = sprintf(__('Your trial period will end on %1$s.', 'wp-multisite-waas'), $date);
|
||||
} // end if;
|
||||
}
|
||||
|
||||
$original_cart = $payment->get_meta('wu_original_cart');
|
||||
|
||||
@ -39,14 +39,14 @@ if ($membership->is_recurring() && $should_auto_renew) {
|
||||
$date_renew = wp_date(get_option('date_format'), strtotime($membership->get_date_expiration(), wu_get_current_time('timestamp', true)));
|
||||
|
||||
$notes[] = sprintf(__('Your updated membership will start on %1$s, from that date you will be billed %2$s %3$s.', 'wp-multisite-waas'), $date_renew, $subtotal, $desc);
|
||||
} // end if;
|
||||
}
|
||||
} elseif ($is_trial_setup) {
|
||||
$initial_amount_format = wu_format_currency($membership->get_initial_amount(), $payment->get_currency());
|
||||
|
||||
$notes[] = sprintf(__('After the first payment of %1$s you will be billed %2$s %3$s.', 'wp-multisite-waas'), $initial_amount_format, $recurring_total_format, $desc);
|
||||
} else {
|
||||
$notes[] = sprintf(__('After this payment you will be billed %1$s %2$s.', 'wp-multisite-waas'), $recurring_total_format, $desc);
|
||||
} // end if;
|
||||
}
|
||||
} else {
|
||||
$recurring_total_format = wu_format_currency($recurring_total, $payment->get_currency());
|
||||
|
||||
@ -54,9 +54,9 @@ if ($membership->is_recurring() && $should_auto_renew) {
|
||||
$notes[] = sprintf(__('From that date, you will be billed %1$s %2$s.', 'wp-multisite-waas'), $recurring_total_format, $desc);
|
||||
} else {
|
||||
$notes[] = sprintf(__('After this payment you will be billed %1$s.', 'wp-multisite-waas'), $desc);
|
||||
} // end if;
|
||||
} // end if;
|
||||
} // end if;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$note = implode(' ', $notes);
|
||||
|
||||
@ -66,7 +66,7 @@ $subtotal = 0;
|
||||
|
||||
<form id="wu-paypal-express-confirm-form" class="wu-styling" action="<?php echo esc_url(add_query_arg('wu-confirm', 'paypal')); ?>" method="post">
|
||||
<div class="wu-confirm-details" id="billing_info">
|
||||
<h2><?php _e('Please confirm your payment', 'wp-multisite-waas'); ?></h2>
|
||||
<h2><?php esc_html_e('Please confirm your payment', 'wp-multisite-waas'); ?></h2>
|
||||
|
||||
<div class="wu-text-sm wu-mb-4 wu-rounded-lg wu-border wu-border-gray-300 wu-bg-white wu-border-solid wu-shadow-sm wu-px-6 wu-py-4">
|
||||
<span class="wu-font-semibold wu-block wu-text-gray-900">
|
||||
@ -75,8 +75,8 @@ $subtotal = 0;
|
||||
|
||||
<div class="wu-text-gray-600">
|
||||
<p>
|
||||
<?php _e('PayPal Status:', 'wp-multisite-waas'); ?> <?php echo ucfirst(wu_get_isset($checkout_details, 'PAYERSTATUS', 'none')); ?>
|
||||
<br><?php _e('Email:', 'wp-multisite-waas'); ?> <?php echo wu_get_isset($checkout_details, 'EMAIL', '--'); ?>
|
||||
<?php esc_html_e('PayPal Status:', 'wp-multisite-waas'); ?> <?php echo ucfirst(wu_get_isset($checkout_details, 'PAYERSTATUS', 'none')); ?>
|
||||
<br><?php esc_html_e('Email:', 'wp-multisite-waas'); ?> <?php echo wu_get_isset($checkout_details, 'EMAIL', '--'); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@ -85,8 +85,8 @@ $subtotal = 0;
|
||||
<table class="wu-w-full wu-mb-4">
|
||||
<thead class="wu-bg-gray-100">
|
||||
<tr>
|
||||
<th class="wu-text-left wu-py-2 wu-px-4"><?php _e('Product', 'wp-multisite-waas'); ?></th>
|
||||
<th class="wu-text-left wu-py-2 wu-px-4"><?php _e('Total', 'wp-multisite-waas'); ?></th>
|
||||
<th class="wu-text-left wu-py-2 wu-px-4"><?php esc_html_e('Product', 'wp-multisite-waas'); ?></th>
|
||||
<th class="wu-text-left wu-py-2 wu-px-4"><?php esc_html_e('Total', 'wp-multisite-waas'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@ -112,7 +112,7 @@ $subtotal = 0;
|
||||
|
||||
<tfoot class="wu-bg-gray-100">
|
||||
<tr>
|
||||
<th class="wu-text-left wu-py-2 wu-px-4"><?php _e('Subtotal', 'wp-multisite-waas'); ?></th>
|
||||
<th class="wu-text-left wu-py-2 wu-px-4"><?php esc_html_e('Subtotal', 'wp-multisite-waas'); ?></th>
|
||||
<th class="wu-text-left wu-py-2 wu-px-4"><?php echo wu_format_currency($subtotal, $payment->get_currency()); ?></th>
|
||||
</tr>
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
|
||||
//phpcs:disable WordPress.NamingConventions.PrefixAllGlobals
|
||||
$duration = $duration ?: 1;
|
||||
$duration_unit = $duration_unit ?: 'month';
|
||||
|
||||
@ -14,58 +14,39 @@ $product_variation = $product->get_as_variation($duration, $duration_unit);
|
||||
|
||||
if (false !== $product_variation) {
|
||||
$product = $product_variation;
|
||||
} // end if;
|
||||
|
||||
}
|
||||
?>
|
||||
<div class="wu-relative wu-flex wu-rounded-lg wu-border wu-border-gray-300 wu-bg-white wu-border-solid wu-shadow-sm wu-px-6 wu-py-4 wu-items-center wu-justify-between">
|
||||
<div class="wu-flex wu-items-center">
|
||||
|
||||
<?php
|
||||
if ($display_product_image) :
|
||||
$image = $product->get_featured_image('thumbnail');
|
||||
?>
|
||||
|
||||
<?php if ($display_product_image) : ?>
|
||||
<?php $image = $product->get_featured_image('thumbnail'); ?>
|
||||
<?php if ($image) : ?>
|
||||
|
||||
<div class="wu-w-thumb wu-h-thumb wu-rounded wu-overflow-hidden wu-text-center wu-inline-block wu-mr-4">
|
||||
<img src="<?php echo esc_attr($image); ?>" class="wu-h-full">
|
||||
</div>
|
||||
|
||||
<div class="wu-w-thumb wu-h-thumb wu-rounded wu-overflow-hidden wu-text-center wu-inline-block wu-mr-4">
|
||||
<img src="<?php echo esc_attr($image); ?>" class="wu-h-full">
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="wu-text-sm">
|
||||
<span class="wu-font-semibold wu-block wu-text-gray-900"><?php echo empty($name) ? esc_html($product->get_name()) : esc_html($name); ?></span>
|
||||
<?php if ($display_product_description && $product->get_description()) : ?>
|
||||
<div class="wu-text-gray-600">
|
||||
<p class="sm:wu-inline-block wu-my-1"><?php echo esc_html($product->get_description()); ?></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="wu-text-gray-600">
|
||||
<p class="sm:wu-inline"><?php echo esc_html($product->get_price_description()); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (! $parent || ! method_exists($parent, 'has_product')) : ?>
|
||||
<div v-if="!($parent.has_product('<?php echo esc_js($product->get_id()); ?>') || $parent.has_product('<?php echo esc_js($product->get_slug()); ?>'))" class="wu-ml-2">
|
||||
<a href="#" @click.prevent="$parent.add_product('<?php echo esc_js($product->get_id()); ?>')" class="button btn"><?php esc_html_e('Add to Cart', 'wp-multisite-waas'); ?></a>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<div v-else class="wu-ml-2">
|
||||
<a href="#" @click.prevent="$parent.remove_product('<?php echo esc_js($product->get_id()); ?>', '<?php echo esc_js($product->get_slug()); ?>')" class="button btn"><?php esc_html_e('Remove', 'wp-multisite-waas'); ?></a>
|
||||
<input type="hidden" name="products[]" value="<?php echo esc_attr($product->get_id()); ?>">
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="wu-text-sm">
|
||||
<span class="wu-font-semibold wu-block wu-text-gray-900"><?php echo empty($name) ? $product->get_name() : $name; ?></span>
|
||||
|
||||
<?php if ($display_product_description && $product->get_description()) : ?>
|
||||
<div class="wu-text-gray-600">
|
||||
<p class="sm:wu-inline-block wu-my-1">
|
||||
<?php echo $product->get_description(); ?>
|
||||
</p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="wu-text-gray-600">
|
||||
<p class="sm:wu-inline">
|
||||
<?php echo $product->get_price_description(); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="!($parent.has_product('<?php echo $product->get_id(); ?>') || $parent.has_product('<?php echo $product->get_slug(); ?>'))" class="wu-ml-2">
|
||||
<a href="#" @click.prevent="$parent.add_product('<?php echo $product->get_id(); ?>')" class="button btn"><?php _e('Add to Cart', 'wp-multisite-waas'); ?></a>
|
||||
</div>
|
||||
<div v-else class="wu-ml-2">
|
||||
<a href="#" @click.prevent="$parent.remove_product('<?php echo $product->get_id(); ?>', '<?php echo $product->get_slug(); ?>')" class="button btn"><?php _e('Remove', 'wp-multisite-waas'); ?></a>
|
||||
<input type="hidden" name="products[]" value="<?php echo $product->get_id(); ?>">
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="wu-absolute wu--inset-px wu-rounded-lg wu-border-solid wu-border-2 wu-pointer-events-none wu-top-0 wu-bottom-0 wu-right-0 wu-left-0"
|
||||
:class="($parent.has_product('<?php echo $product->get_id(); ?>') || $parent.has_product('<?php echo $product->get_slug(); ?>'))? 'wu-border-blue-500' : 'wu-border-transparent'"
|
||||
aria-hidden="true"
|
||||
>
|
||||
</div>
|
||||
<div class="wu-absolute wu--inset-px wu-rounded-lg wu-border-solid wu-pointer-events-none wu-top-0 wu-bottom-0 wu-right-0 wu-left-0" :class="($parent.has_product('<?php echo esc_js($product->get_id()); ?>') || $parent.has_product('<?php echo esc_js($product->get_slug()); ?>')) ? 'wu-border-blue-500' : 'wu-border-transparent'" aria-hidden="true"></div>
|
||||
</div>
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
<div v-show="!order" class="wu-bg-gray-100 wu-p-4 wu-text-center wu-border wu-border-solid wu-border-gray-300">
|
||||
|
||||
<?php _e('Generating Order Summary...', 'wp-multisite-waas'); ?>
|
||||
<?php esc_html_e('Generating Order Summary...', 'wp-multisite-waas'); ?>
|
||||
|
||||
</div>
|
||||
|
||||
@ -22,31 +22,31 @@
|
||||
<tr class="">
|
||||
|
||||
<th class="col-description">
|
||||
<?php _e('Description', 'wp-multisite-waas'); ?>
|
||||
<?php esc_html_e('Description', 'wp-multisite-waas'); ?>
|
||||
</th>
|
||||
|
||||
<?php if ('simple' === $table_columns) : ?>
|
||||
|
||||
<th class="col-total-gross">
|
||||
<?php _e('Subtotal', 'wp-multisite-waas'); ?>
|
||||
<?php esc_html_e('Subtotal', 'wp-multisite-waas'); ?>
|
||||
</th>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<th class="col-total-net">
|
||||
<?php _e('Net Total', 'wp-multisite-waas'); ?>
|
||||
<?php esc_html_e('Net Total', 'wp-multisite-waas'); ?>
|
||||
</th>
|
||||
|
||||
<th class="col-total-vat-percentage">
|
||||
<?php _e('Discounts', 'wp-multisite-waas'); ?>
|
||||
<?php esc_html_e('Discounts', 'wp-multisite-waas'); ?>
|
||||
</th>
|
||||
|
||||
<th class="col-total-tax">
|
||||
<?php _e('Tax', 'wp-multisite-waas'); ?>
|
||||
<?php esc_html_e('Tax', 'wp-multisite-waas'); ?>
|
||||
</th>
|
||||
|
||||
<th class="col-total-gross">
|
||||
<?php _e('Gross Total', 'wp-multisite-waas'); ?>
|
||||
<?php esc_html_e('Gross Total', 'wp-multisite-waas'); ?>
|
||||
</th>
|
||||
|
||||
<?php endif; ?>
|
||||
@ -61,7 +61,7 @@
|
||||
|
||||
<td class="" colspan="<?php echo esc_attr('simple' === $table_columns) ? 2 : 5; ?>" class="col-description">
|
||||
|
||||
<?php _e('No products in shopping cart.', 'wp-multisite-waas'); ?>
|
||||
<?php esc_html_e('No products in shopping cart.', 'wp-multisite-waas'); ?>
|
||||
|
||||
</td>
|
||||
|
||||
@ -71,13 +71,13 @@
|
||||
|
||||
<td class="wu-py-2 col-description" v-show="line_item.recurring">
|
||||
|
||||
<?php printf(__('Subscription - %s', 'wp-multisite-waas'), '{{ line_item.title }}'); ?>
|
||||
<?php printf(esc_html__('Subscription - %s', 'wp-multisite-waas'), '{{ line_item.title }}'); ?>
|
||||
|
||||
<small v-if="line_item.type == 'product'" class="wu-ml-3 wu-text-xs">
|
||||
|
||||
<a href="#" class="wu-no-underline" v-on:click.prevent="remove_product(line_item.product_id, line_item.product_slug)">
|
||||
|
||||
<?php _e('Remove', 'wp-multisite-waas'); ?>
|
||||
<?php esc_html_e('Remove', 'wp-multisite-waas'); ?>
|
||||
|
||||
</a>
|
||||
|
||||
@ -93,7 +93,7 @@
|
||||
|
||||
<a href="#" class="wu-no-underline" v-on:click.prevent="remove_product(line_item.product_id, line_item.product_slug)">
|
||||
|
||||
<?php _e('Remove', 'wp-multisite-waas'); ?>
|
||||
<?php esc_html_e('Remove', 'wp-multisite-waas'); ?>
|
||||
|
||||
</a>
|
||||
|
||||
@ -167,7 +167,7 @@
|
||||
|
||||
<td>
|
||||
|
||||
<?php _e('Discounts', 'wp-multisite-waas'); ?>
|
||||
<?php esc_html_e('Discounts', 'wp-multisite-waas'); ?>
|
||||
|
||||
</td>
|
||||
|
||||
@ -183,7 +183,7 @@
|
||||
|
||||
<td>
|
||||
|
||||
<?php _e('Taxes', 'wp-multisite-waas'); ?>
|
||||
<?php esc_html_e('Taxes', 'wp-multisite-waas'); ?>
|
||||
|
||||
</td>
|
||||
|
||||
@ -201,7 +201,7 @@
|
||||
|
||||
<td class="" colspan="<?php echo esc_attr('simple' === $table_columns) ? 1 : 4; ?>">
|
||||
|
||||
<strong><?php _e("Today's Grand Total", 'wp-multisite-waas'); ?></strong>
|
||||
<strong><?php esc_html_e("Today's Grand Total", 'wp-multisite-waas'); ?></strong>
|
||||
|
||||
</td>
|
||||
|
||||
@ -224,7 +224,7 @@
|
||||
<td class="" colspan="<?php echo esc_attr('simple' === $table_columns) ? 1 : 4; ?>">
|
||||
|
||||
<small>
|
||||
<?php printf(__('Total in %1$s - end of trial period.', 'wp-multisite-waas'), '{{ $moment.unix(order.dates.date_trial_end).format(`LL`) }}'); ?>
|
||||
<?php printf(esc_html__('Total in %1$s - end of trial period.', 'wp-multisite-waas'), '{{ $moment.unix(order.dates.date_trial_end).format(`LL`) }}'); ?>
|
||||
</small>
|
||||
|
||||
</td>
|
||||
@ -245,7 +245,7 @@
|
||||
|
||||
<li v-if="!order.has_trial && order.has_recurring">
|
||||
|
||||
<?php printf(__('Next fee of %1$s will be billed in %2$s.', 'wp-multisite-waas'), '{{ wu_format_money(order.totals.recurring.total) }}', '{{ $moment.unix(order.dates.date_next_charge).format(`LL`) }}'); ?>
|
||||
<?php printf(esc_html__('Next fee of %1$s will be billed in %2$s.', 'wp-multisite-waas'), '{{ wu_format_money(order.totals.recurring.total) }}', '{{ $moment.unix(order.dates.date_next_charge).format(`LL`) }}'); ?>
|
||||
|
||||
</li>
|
||||
|
||||
@ -253,12 +253,12 @@
|
||||
|
||||
<?php
|
||||
// translators: 1 is the discount name (e.g. Launch Promo). 2 is the coupon code (e.g PROMO10), 3 is the coupon amount and 4 is the discount total.
|
||||
printf(__('Discount applied: %1$s - %2$s (%3$s) %4$s', 'wp-multisite-waas'), '{{ order.discount_code.name }}', '{{ order.discount_code.code }}', '{{ order.discount_code.discount_description }}', '{{ wu_format_money(-order.totals.total_discounts) }}');
|
||||
printf(esc_html__('Discount applied: %1$s - %2$s (%3$s) %4$s', 'wp-multisite-waas'), '{{ order.discount_code.name }}', '{{ order.discount_code.code }}', '{{ order.discount_code.discount_description }}', '{{ wu_format_money(-order.totals.total_discounts) }}');
|
||||
?>
|
||||
|
||||
<a class="wu-no-underline wu-ml-2" href="#" v-on:click.prevent="discount_code = ''">
|
||||
|
||||
<?php _e('Remove', 'wp-multisite-waas'); ?>
|
||||
<?php esc_html_e('Remove', 'wp-multisite-waas'); ?>
|
||||
|
||||
</a>
|
||||
|
||||
|
@ -24,12 +24,12 @@ defined('ABSPATH') || exit;
|
||||
<?php foreach ($period_options as $index => $period_option) : ?>
|
||||
|
||||
<li class="wu-mx-2">
|
||||
<a
|
||||
:class="(duration == <?php echo $period_option['duration']; ?> && duration_unit == '<?php echo $period_option['duration_unit']; ?>') || (<?php echo json_encode(0 === $index); ?> && duration === '') ? 'wu-font-semibold active' : ''"
|
||||
v-on:click.prevent="duration = <?php echo $period_option['duration']; ?>; duration_unit = '<?php echo $period_option['duration_unit']; ?>'"
|
||||
<a
|
||||
:class="(duration == <?php echo esc_attr($period_option['duration']); ?> && duration_unit == '<?php echo esc_attr($period_option['duration_unit']); ?>') || (<?php echo wp_json_encode(0 === $index); ?> && duration === '') ? 'wu-font-semibold active' : ''"
|
||||
v-on:click.prevent="duration = <?php echo esc_attr($period_option['duration']); ?>; duration_unit = '<?php echo esc_attr($period_option['duration_unit']); ?>'"
|
||||
href="#"
|
||||
>
|
||||
<?php echo $period_option['label']; ?>
|
||||
<?php echo esc_html($period_option['label']); ?>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
@ -27,8 +27,8 @@ defined('ABSPATH') || exit;
|
||||
<?php foreach ($period_options as $index => $period_option) : ?>
|
||||
|
||||
<li>
|
||||
<a class="wu-text-center" :class="(duration == <?php echo $period_option['duration']; ?> && duration_unit == '<?php echo $period_option['duration_unit']; ?>') || (<?php echo json_encode(0 === $index); ?> && duration === '') ? 'active' : ''" v-on:click.prevent="duration = <?php echo $period_option['duration']; ?>; duration_unit = '<?php echo $period_option['duration_unit']; ?>'" href="#">
|
||||
<?php echo $period_option['label']; ?>
|
||||
<a class="wu-text-center" :class="(duration == <?php echo esc_html($period_option['duration']); ?> && duration_unit == '<?php echo esc_attr($period_option['duration_unit']); ?>') || (<?php echo wp_json_encode(0 === $index); ?> && duration === '') ? 'active' : ''" v-on:click.prevent="duration = <?php echo esc_attr($period_option['duration']); ?>; duration_unit = '<?php echo esc_attr($period_option['duration_unit']); ?>'" href="#">
|
||||
<?php echo esc_html($period_option['label']); ?>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
@ -19,9 +19,9 @@ $first_recurring_product = array_reduce(
|
||||
$products_to_reduce,
|
||||
function ($chosen_product, $product) {
|
||||
|
||||
if ($product && $product->is_recurring() && false == $chosen_product) {
|
||||
if ($product && $product->is_recurring() && ! $chosen_product) {
|
||||
$chosen_product = $product;
|
||||
} // end if;
|
||||
}
|
||||
|
||||
return $chosen_product;
|
||||
}
|
||||
@ -32,8 +32,8 @@ $legacy_mode = array_reduce(
|
||||
function ($all_have_same_duration, $product) use ($first_recurring_product) {
|
||||
|
||||
if ($product && $product->is_recurring()) {
|
||||
$all_have_same_duration = $first_recurring_product->get_recurring_description() == $product->get_recurring_description();
|
||||
} // end if;
|
||||
$all_have_same_duration = $first_recurring_product->get_recurring_description() === $product->get_recurring_description();
|
||||
}
|
||||
|
||||
return $all_have_same_duration;
|
||||
}
|
||||
@ -52,8 +52,8 @@ wp_add_inline_script(
|
||||
window.wu_legacy_mode = %s;
|
||||
|
||||
',
|
||||
json_encode($force_different_durations),
|
||||
json_encode($legacy_mode)
|
||||
wp_json_encode($force_different_durations),
|
||||
wp_json_encode($legacy_mode)
|
||||
),
|
||||
'after'
|
||||
);
|
||||
@ -76,21 +76,21 @@ if (null !== $first_recurring_product) {
|
||||
|
||||
data.duration = %s;
|
||||
|
||||
} // end if;
|
||||
}
|
||||
|
||||
if (!data.duration_unit && !wu_force_different_durations) {
|
||||
|
||||
data.duration_unit = %s;
|
||||
|
||||
} // end if;
|
||||
}
|
||||
|
||||
return data;
|
||||
|
||||
});
|
||||
|
||||
",
|
||||
json_encode($first_recurring_product->get_duration()),
|
||||
json_encode($first_recurring_product->get_duration_unit())
|
||||
wp_json_encode($first_recurring_product->get_duration()),
|
||||
wp_json_encode($first_recurring_product->get_duration_unit())
|
||||
),
|
||||
'after'
|
||||
);
|
||||
@ -101,7 +101,7 @@ if (null !== $first_recurring_product) {
|
||||
|
||||
<div class="wu-text-center wu-bg-gray-100 wu-rounded wu-uppercase wu-font-semibold wu-text-xs wu-text-gray-700 wu-p-4">
|
||||
|
||||
<?php _e('No Products Found.', 'wp-multisite-waas'); ?>
|
||||
<?php esc_html_e('No Products Found.', 'wp-multisite-waas'); ?>
|
||||
|
||||
</div>
|
||||
|
||||
@ -115,8 +115,8 @@ if (null !== $first_recurring_product) {
|
||||
|
||||
<div
|
||||
id="plan-<?php echo esc_attr($product->get_id()); ?>"
|
||||
class="<?php echo "wu-product-{$product->get_id()}"; ?> lift wu-plan plan-tier wu-flex-1 <?php echo esc_attr($product->is_featured_plan() ? 'callout' : ''); ?> wu-flex wu-flex-col wu-justify-between"
|
||||
v-show="wu_force_different_durations || (duration && wu_legacy_mode) || (( (!duration) || duration == <?php echo $product->get_duration(); ?> && duration_unit == '<?php echo $product->get_duration_unit(); ?>' ) || <?php echo json_encode($product->get_pricing_type() !== 'paid'); ?>)"
|
||||
class="<?php echo esc_attr("wu-product-{$product->get_id()}"); ?> lift wu-plan plan-tier wu-flex-1 <?php echo esc_attr($product->is_featured_plan() ? 'callout' : ''); ?> wu-flex wu-flex-col wu-justify-between"
|
||||
v-show="wu_force_different_durations || (duration && wu_legacy_mode) || (( (!duration) || duration == <?php echo esc_attr($product->get_duration()); ?> && duration_unit == '<?php echo esc_attr($product->get_duration_unit()); ?>' ) || <?php echo wp_json_encode($product->get_pricing_type() !== 'paid'); ?>)"
|
||||
>
|
||||
|
||||
<div class="wu-relative">
|
||||
@ -130,7 +130,7 @@ if (null !== $first_recurring_product) {
|
||||
/**
|
||||
* Featured tag.
|
||||
*/
|
||||
echo apply_filters('wu_featured_plan_label', __('Featured Plan', 'wp-multisite-waas'), $product);
|
||||
echo esc_html(apply_filters('wu_featured_plan_label', __('Featured Plan', 'wp-multisite-waas'), $product));
|
||||
|
||||
?>
|
||||
|
||||
@ -140,7 +140,7 @@ if (null !== $first_recurring_product) {
|
||||
|
||||
<h4 class="wp-ui-primary">
|
||||
|
||||
<?php echo $product->get_name(); ?>
|
||||
<?php echo esc_html($product->get_name()); ?>
|
||||
|
||||
</h4>
|
||||
|
||||
@ -158,7 +158,7 @@ if (null !== $first_recurring_product) {
|
||||
|
||||
<span class="plan-price">
|
||||
|
||||
<?php _e('Free!', 'wp-multisite-waas'); ?>
|
||||
<?php esc_html_e('Free!', 'wp-multisite-waas'); ?>
|
||||
|
||||
</span>
|
||||
|
||||
@ -178,7 +178,7 @@ if (null !== $first_recurring_product) {
|
||||
|
||||
<span class="plan-price">
|
||||
|
||||
<?php echo apply_filters('wu_plan_contact_us_price_line', __('--', 'wp-multisite-waas')); ?>
|
||||
<?php echo esc_html(apply_filters('wu_plan_contact_us_price_line', __('--', 'wp-multisite-waas'))); ?>
|
||||
|
||||
</span>
|
||||
|
||||
@ -195,7 +195,7 @@ if (null !== $first_recurring_product) {
|
||||
* Price display.
|
||||
*/
|
||||
|
||||
$symbol_left = in_array(wu_get_setting('currency_position', '%s%v'), ['%s%v', '%s %v']);
|
||||
$symbol_left = in_array(wu_get_setting('currency_position', '%s%v'), ['%s%v', '%s %v'], true);
|
||||
|
||||
?>
|
||||
|
||||
@ -203,19 +203,19 @@ if (null !== $first_recurring_product) {
|
||||
|
||||
<sup class="superscript">
|
||||
|
||||
<?php echo wu_get_currency_symbol($product->get_currency()); ?>
|
||||
<?php esc_html(wu_get_currency_symbol($product->get_currency())); ?>
|
||||
|
||||
</sup>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<span class="plan-price" v-if="wu_force_different_durations || (duration == <?php echo $product->get_duration(); ?> && duration_unit == '<?php echo $product->get_duration_unit(); ?>')">
|
||||
<span class="plan-price" v-if="wu_force_different_durations || (duration == <?php echo esc_attr($product->get_duration()); ?> && duration_unit == '<?php echo esc_attr($product->get_duration_unit()); ?>')">
|
||||
|
||||
<?php
|
||||
|
||||
$n = $product->get_amount();
|
||||
|
||||
echo str_replace(wu_get_currency_symbol(), '', wu_format_currency($n));
|
||||
echo esc_html(str_replace(wu_get_currency_symbol(), '', wu_format_currency($n)));
|
||||
|
||||
?>
|
||||
|
||||
@ -227,21 +227,21 @@ if (null !== $first_recurring_product) {
|
||||
|
||||
if ( ! $price_variation) {
|
||||
continue;
|
||||
} // end if;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<span class="plan-price" v-cloak v-if="duration == <?php echo $price_variation['duration']; ?> && duration_unit == '<?php echo $price_variation['duration_unit']; ?>'">
|
||||
<span class="plan-price" v-cloak v-if="duration == <?php echo esc_attr($price_variation['duration']); ?> && duration_unit == '<?php echo esc_attr($price_variation['duration_unit']); ?>'">
|
||||
|
||||
<?php
|
||||
|
||||
$n = $price_variation ? $price_variation['monthly_amount'] : false;
|
||||
|
||||
if ($n) {
|
||||
echo str_replace(wu_get_currency_symbol(), '', wu_format_currency($n));
|
||||
echo esc_html(str_replace(wu_get_currency_symbol(), '', wu_format_currency($n)));
|
||||
} else {
|
||||
echo '--';
|
||||
} // end if;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@ -249,7 +249,7 @@ if (null !== $first_recurring_product) {
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
<sub v-if="1 == <?php echo $product->get_duration(); ?> && 'month' == '<?php echo $product->get_duration_unit(); ?>'">
|
||||
<sub v-if="1 == <?php echo esc_attr($product->get_duration()); ?> && 'month' == '<?php echo $product->get_duration_unit(); ?>'">
|
||||
|
||||
<?php
|
||||
|
||||
@ -312,7 +312,7 @@ if (null !== $first_recurring_product) {
|
||||
$price_variation = $product->get_price_variation($freq, 'month');
|
||||
|
||||
if ( ! $price_variation || $product->get_pricing_type() == 'free' || $product->get_pricing_type() == 'contact_us') {
|
||||
echo "<li v-cloak v-show='duration == " . $freq . "' class='total-price total-price-$freq'>-</li>";
|
||||
echo "<li v-cloak v-show='duration == " . esc_attr($freq) . "' class='total-price total-price-($freq)'>-</li>";
|
||||
} else {
|
||||
$text = sprintf(__('%1$s, billed %2$s', 'wp-multisite-waas'), wu_format_currency($price_variation['amount']), $string);
|
||||
|
||||
@ -320,11 +320,11 @@ if (null !== $first_recurring_product) {
|
||||
|
||||
if (12 === $freq) {
|
||||
$extra_check_for_annual = ' || (duration == "1" && duration_unit == "year")';
|
||||
} // end if;
|
||||
}
|
||||
|
||||
echo "<li v-cloak v-show='duration == " . $freq . $extra_check_for_annual . "' class='total-price total-price-$freq'>$text</li>";
|
||||
} // end if;
|
||||
} // end foreach;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@ -337,14 +337,14 @@ if (null !== $first_recurring_product) {
|
||||
<li class="wu-cta">
|
||||
|
||||
<button
|
||||
v-if="<?php echo json_encode($product->get_pricing_type() !== 'contact_us'); ?>"
|
||||
v-if="<?php echo wp_json_encode($product->get_pricing_type() !== 'contact_us'); ?>"
|
||||
v-on:click="add_plan(<?php echo $product->get_id(); ?>)"
|
||||
type="button"
|
||||
name="products[]"
|
||||
value="<?php echo $product->get_id(); ?>"
|
||||
class="button button-primary button-next"
|
||||
>
|
||||
<?php _e('Select Plan', 'wp-multisite-waas'); ?>
|
||||
<?php esc_html_e('Select Plan', 'wp-multisite-waas'); ?>
|
||||
</button>
|
||||
|
||||
<button
|
||||
@ -354,7 +354,7 @@ if (null !== $first_recurring_product) {
|
||||
value="<?php echo $product->get_id(); ?>"
|
||||
class="button button-primary button-next"
|
||||
>
|
||||
<?php _e('Select Plan', 'wp-multisite-waas'); ?>
|
||||
<?php esc_html_e('Select Plan', 'wp-multisite-waas'); ?>
|
||||
</button>
|
||||
|
||||
</li>
|
||||
|
@ -17,8 +17,8 @@ foreach ($products as $index => &$_product) {
|
||||
unset($products[ $index ]);
|
||||
|
||||
$_product = $product_variation;
|
||||
} // end if;
|
||||
} // end foreach;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="">
|
||||
@ -31,7 +31,7 @@ foreach ($products as $index => &$_product) {
|
||||
id="wu-product-<?php echo $product->get_id(); ?>"
|
||||
class="wu-relative wu-block wu-rounded-lg wu-border wu-border-gray-300 wu-bg-white wu-border-solid wu-shadow-sm wu-px-6 wu-py-4 wu-cursor-pointer hover:wu-border-gray-400 sm:wu-flex sm:wu-justify-between focus-within:wu-ring-1 focus-within:wu-ring-offset-2 focus-within:wu-ring-indigo-500">
|
||||
|
||||
<input v-if="<?php echo json_encode($product->get_pricing_type() !== 'contact_us'); ?>" v-on:click="$parent.add_plan(<?php echo $product->get_id(); ?>)" type="checkbox" name="products[]" value="<?php echo $product->get_id(); ?>" class="screen-reader-text wu-hidden">
|
||||
<input v-if="<?php echo wp_json_encode($product->get_pricing_type() !== 'contact_us'); ?>" v-on:click="$parent.add_plan(<?php echo $product->get_id(); ?>)" type="checkbox" name="products[]" value="<?php echo $product->get_id(); ?>" class="screen-reader-text wu-hidden">
|
||||
|
||||
<input v-else v-on:click="$parent.open_url('<?php echo esc_url($product->get_contact_us_link()); ?>', '_blank');" type="checkbox" name="products[]" value="<?php echo $product->get_id(); ?>" class="screen-reader-text wu-hidden">
|
||||
|
||||
|
@ -43,7 +43,7 @@ if ( ! defined('ABSPATH')) {
|
||||
} elseif (array_search($current_step, array_column($steps, 'id')) > array_search($step_key, array_column($steps, 'id'))) {
|
||||
$container_class = 'wu-opacity-50';
|
||||
$color = 'blue';
|
||||
} // end if;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
@ -38,7 +38,7 @@ if ( ! defined('ABSPATH')) {
|
||||
$class = 'active';
|
||||
} elseif (array_search($current_step, array_column($steps, 'id')) > array_search($step_key, array_column($steps, 'id'))) {
|
||||
$class = 'done';
|
||||
} // end if;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
@ -41,7 +41,7 @@ if ( ! defined('ABSPATH')) {
|
||||
$class = 'step-current';
|
||||
} elseif (array_search($current_step, array_column($steps, 'id')) > array_search($step_key, array_column($steps, 'id'))) {
|
||||
$class = 'step-done';
|
||||
} // end if;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
@ -8,6 +8,7 @@
|
||||
* See more here: https://help.wpultimo.com/article/335-template-overrides.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @package WP_Ultimo/Views
|
||||
* @param array $products List of product objects.
|
||||
* @param string $name ID of the field.
|
||||
* @param string $label The field label.
|
||||
@ -23,7 +24,7 @@ if (isset($should_display) && ! $should_display) {
|
||||
<?php
|
||||
|
||||
return;
|
||||
} // end if;
|
||||
}
|
||||
|
||||
$sites = array_map('wu_get_site', $sites ?? []);
|
||||
|
||||
@ -39,110 +40,114 @@ $customer_sites = isset($customer_sites) ? array_map('intval', $customer_sites)
|
||||
|
||||
<ul id="wu-site-template-filter" class="wu-bg-white wu-border-solid wu-border wu-border-gray-300 wu-shadow-sm wu-p-4 wu-flex wu-rounded wu-relative wu-m-0 wu-mb-4 wu-list-none">
|
||||
|
||||
<li class="wu-site-template-filter-all wu-mx-2 wu-my-0">
|
||||
<a
|
||||
href="#"
|
||||
data-category=""
|
||||
:class="$parent.template_category === '' ? 'current wu-font-semibold' : ''"
|
||||
v-on:click.prevent="$parent.template_category = ''"
|
||||
>
|
||||
<?php _e('All', 'wp-multisite-waas'); ?>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php if ( ! empty($customer_sites)) : ?>
|
||||
|
||||
<li class="wu-site-template-filter-<?php echo esc_attr(sanitize_title($customer_sites_category)); ?> wu-mx-2 wu-my-0">
|
||||
<a
|
||||
href="#"
|
||||
data-category="<?php echo esc_attr($customer_sites_category); ?>"
|
||||
:class="$parent.template_category === '<?php echo esc_attr($customer_sites_category); ?>' ? 'current wu-font-semibold' : ''"
|
||||
v-on:click.prevent="$parent.template_category = '<?php echo esc_attr($customer_sites_category); ?>'"
|
||||
><?php echo $customer_sites_category; ?></a>
|
||||
</li>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (isset($categories) && $categories) : ?>
|
||||
|
||||
<?php foreach ($categories as $category) : ?>
|
||||
|
||||
<li class="wu-site-template-filter-<?php echo esc_attr(sanitize_title($category)); ?> wu-mx-2 wu-my-0">
|
||||
<li class="wu-site-template-filter-all wu-mx-2 wu-my-0">
|
||||
<a
|
||||
href="#"
|
||||
data-category="<?php echo esc_attr($category); ?>"
|
||||
:class="$parent.template_category === '<?php echo esc_attr($category); ?>' ? 'current wu-font-semibold' : ''"
|
||||
v-on:click.prevent="$parent.template_category = '<?php echo esc_attr($category); ?>'"
|
||||
><?php echo $category; ?></a>
|
||||
href="#"
|
||||
data-category=""
|
||||
:class="$parent.template_category === '' ? 'current wu-font-semibold' : ''"
|
||||
v-on:click.prevent="$parent.template_category = ''"
|
||||
>
|
||||
<?php esc_html_e('All', 'wp-multisite-waas'); ?>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php endforeach; ?>
|
||||
<?php if ( ! empty($customer_sites)) : ?>
|
||||
|
||||
<?php endif; ?>
|
||||
<li class="wu-site-template-filter-<?php echo esc_attr(sanitize_title($customer_sites_category)); ?> wu-mx-2 wu-my-0">
|
||||
<a
|
||||
href="#"
|
||||
data-category="<?php echo esc_attr($customer_sites_category); ?>"
|
||||
:class="$parent.template_category === '<?php echo esc_attr($customer_sites_category); ?>' ? 'current wu-font-semibold' : ''"
|
||||
v-on:click.prevent="$parent.template_category = '<?php echo esc_attr($customer_sites_category); ?>'"
|
||||
><?php echo esc_html($customer_sites_category); ?></a>
|
||||
</li>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (isset($categories) && $categories) : ?>
|
||||
|
||||
<?php foreach ($categories as $category) : ?>
|
||||
|
||||
<li class="wu-site-template-filter-<?php echo esc_attr(sanitize_title($category)); ?> wu-mx-2 wu-my-0">
|
||||
<a
|
||||
href="#"
|
||||
data-category="<?php echo esc_attr($category); ?>"
|
||||
:class="$parent.template_category === '<?php echo esc_attr($category); ?>' ? 'current wu-font-semibold' : ''"
|
||||
v-on:click.prevent="$parent.template_category = '<?php echo esc_attr($category); ?>'"
|
||||
>
|
||||
<?php echo esc_html($category); ?></a>
|
||||
</li>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</ul>
|
||||
|
||||
<div id="wu-site-template-container-grid" class="wu-grid wu-grid-cols-1 sm:wu-grid-cols-2 md:wu-grid-cols-<?php echo $cols ?? '3'; ?> wu-gap-4">
|
||||
|
||||
<?php foreach ($sites as $site_template) : ?>
|
||||
<div id="wu-site-template-container-grid" class="wu-grid wu-grid-cols-1 sm:wu-grid-cols-2 md:wu-grid-cols-<?php echo esc_attr($cols ?? '3'); ?> wu-gap-4">
|
||||
|
||||
<?php
|
||||
if ($site_template->get_type() !== 'site_template' && ! in_array($site_template->get_id(), $customer_sites, true)) {
|
||||
continue; }
|
||||
?>
|
||||
<?php foreach ($sites as $site_template) : ?>
|
||||
|
||||
<?php $is_template = $site_template->get_type() === 'site_template'; ?>
|
||||
<?php
|
||||
if ($site_template->get_type() !== 'site_template' && ! in_array($site_template->get_id(), $customer_sites, true)) {
|
||||
continue; }
|
||||
?>
|
||||
|
||||
<?php $categories = array_merge($site_template->get_categories(), ! $is_template ? [$customer_sites_category] : []); ?>
|
||||
<?php $is_template = $site_template->get_type() === 'site_template'; ?>
|
||||
|
||||
<div
|
||||
id="wu-site-template-<?php echo esc_attr($site_template->get_id()); ?>"
|
||||
class="wu-bg-white wu-border-solid wu-border wu-border-gray-300 wu-shadow-sm wu-p-4 wu-rounded wu-relative"
|
||||
v-show="!$parent.template_category || <?php echo esc_attr(json_encode($categories)); ?>.join(',').indexOf($parent.template_category) > -1"
|
||||
v-cloak
|
||||
>
|
||||
<?php $categories = array_merge($site_template->get_categories(), ! $is_template ? [$customer_sites_category] : []); ?>
|
||||
|
||||
<div class="wu-site-template-image-container wu-relative">
|
||||
<div
|
||||
id="wu-site-template-<?php echo esc_attr($site_template->get_id()); ?>"
|
||||
class="wu-bg-white wu-border-solid wu-border wu-border-gray-300 wu-shadow-sm wu-p-4 wu-rounded wu-relative"
|
||||
|
||||
v-show="!$parent.template_category || <?php echo esc_attr(wp_json_encode($categories)); ?>.join(',').indexOf($parent.template_category) > -1"
|
||||
v-cloak
|
||||
>
|
||||
|
||||
<div class="wu-site-template-image-container wu-relative">
|
||||
|
||||
<a
|
||||
title="<?php esc_attr_e('View Template Preview', 'wp-multisite-waas'); ?>"
|
||||
class="wu-site-template-selector wu-cursor-pointer wu-no-underline"
|
||||
<?php echo $is_template ? $site_template->get_preview_url_attrs() : sprintf('href="%s" target="_blank"', $site_template->get_active_site_url()); ?>
|
||||
<?php echo $is_template ? $site_template->get_preview_url_attrs() : sprintf('href="%s" target="_blank"', $site_template->get_active_site_url()); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
>
|
||||
|
||||
<img class="wu-site-template-image wu-w-full wu-border-solid wu-border wu-border-gray-300 wu-mb-4 wu-bg-white" src="<?php echo esc_attr($site_template->get_featured_image()); ?>" alt="<?php echo $site_template->get_title(); ?>">
|
||||
|
||||
</a>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3 class="wu-site-template-title wu-text-lg wu-font-semibold">
|
||||
<h3 class="wu-site-template-title wu-text-lg wu-font-semibold">
|
||||
|
||||
<?php echo $site_template->get_title(); ?>
|
||||
|
||||
</h3>
|
||||
<?php echo esc_html($site_template->get_title()); ?>
|
||||
|
||||
<p class="wu-site-template-description wu-text-sm">
|
||||
</h3>
|
||||
|
||||
<?php echo $site_template->get_description(); ?>
|
||||
<p class="wu-site-template-description wu-text-sm">
|
||||
|
||||
</p>
|
||||
|
||||
<div class="wu-mt-4">
|
||||
<?php echo esc_html($site_template->get_description()); ?>
|
||||
|
||||
<button v-on:click.prevent="$parent.template_id = <?php echo esc_attr($site_template->get_id()); ?>" type="button" class="wu-site-template-selector button btn button-primary btn-primary wu-w-full wu-text-center wu-cursor-pointer">
|
||||
</p>
|
||||
|
||||
<span v-if="$parent.template_id == <?php echo esc_attr($site_template->get_id()); ?>"><?php _e('Selected', 'wp-multisite-waas'); ?></span>
|
||||
<div class="wu-mt-4">
|
||||
|
||||
<span v-else><?php _e('Select', 'wp-multisite-waas'); ?></span>
|
||||
<button v-on:click.prevent="$parent.template_id = <?php echo esc_attr($site_template->get_id()); ?>" type="button" class="wu-site-template-selector button btn button-primary btn-primary wu-w-full wu-text-center wu-cursor-pointer">
|
||||
|
||||
</button>
|
||||
<span v-if="$parent.template_id == <?php echo esc_attr($site_template->get_id()); ?>"><?php esc_html_e('Selected', 'wp-multisite-waas'); ?></span>
|
||||
|
||||
</div>
|
||||
<span v-else><?php esc_html_e('Select', 'wp-multisite-waas'); ?></span>
|
||||
|
||||
</div>
|
||||
</button>
|
||||
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
</div>
|
||||
|
||||
|
@ -2,26 +2,28 @@
|
||||
/**
|
||||
* Template File: Basic Pricing Table.
|
||||
*
|
||||
* To see what methods are available on the product variable, @see inc/models/class-products.php.
|
||||
* To see what methods are available on the product variable, @param array $products List of product objects.
|
||||
*
|
||||
* @param string $name ID of the field.
|
||||
* @param string $label The field label.
|
||||
*
|
||||
* @see inc/models/class-products.php.
|
||||
*
|
||||
* This template can also be overridden using template overrides.
|
||||
* See more here: https://help.wpultimo.com/article/335-template-overrides.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @param array $products List of product objects.
|
||||
* @param string $name ID of the field.
|
||||
* @param string $label The field label.
|
||||
* @package WP_Ultimo/Views
|
||||
*/
|
||||
|
||||
// Exit if accessed directly
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
if ( ! $should_display) {
|
||||
if ( ! $should_display ) {
|
||||
echo '<div></div>';
|
||||
|
||||
return;
|
||||
} // end if;
|
||||
|
||||
}
|
||||
$sites = array_map('wu_get_site', $sites ?? []);
|
||||
|
||||
$categories ??= [];
|
||||
@ -32,234 +34,232 @@ $customer_sites = isset($customer_sites) ? array_map('intval', $customer_sites)
|
||||
|
||||
?>
|
||||
|
||||
<?php if (empty($sites)) : ?>
|
||||
<?php if ( empty($sites) ) : ?>
|
||||
|
||||
<div
|
||||
class="wu-text-center wu-bg-gray-100 wu-rounded wu-uppercase wu-font-semibold wu-text-xs wu-text-gray-700 wu-p-4"
|
||||
>
|
||||
|
||||
<?php _e('No Site Templates Found.', 'wp-multisite-waas'); ?>
|
||||
|
||||
</div>
|
||||
<div class="wu-text-center wu-bg-gray-100 wu-rounded wu-uppercase wu-font-semibold wu-text-xs wu-text-gray-700 wu-p-4">
|
||||
<?php esc_html_e('No Site Templates Found.', 'wp-multisite-waas'); ?>
|
||||
</div>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<div class="themes-php wu-styling">
|
||||
<div class="themes-php wu-styling">
|
||||
|
||||
<div class="wrap wu-template-selection">
|
||||
<div class="wrap wu-template-selection">
|
||||
|
||||
<?php
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Allow developers to hide the title.
|
||||
*/
|
||||
if (apply_filters('wu_step_template_display_header', true)) :
|
||||
/**
|
||||
* Allow developers to hide the title.
|
||||
*/
|
||||
if ( apply_filters('wu_step_template_display_header', true) ) :
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
<h2>
|
||||
<h2>
|
||||
|
||||
<?php _e('Pick your Template', 'wp-multisite-waas'); ?>
|
||||
<?php esc_html_e('Pick your Template', 'wp-multisite-waas'); ?>
|
||||
|
||||
<span class="title-count theme-count">
|
||||
<span class="title-count theme-count">
|
||||
<?php echo count($sites); ?>
|
||||
</span>
|
||||
|
||||
<?php echo count($sites); ?>
|
||||
|
||||
</span>
|
||||
|
||||
</h2>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="wp-filter">
|
||||
|
||||
<div class="wp-filter-responsive">
|
||||
|
||||
<h4><?php _e('Template Categories', 'wp-multisite-waas'); ?></h4>
|
||||
|
||||
<select class="">
|
||||
|
||||
<option value="">
|
||||
|
||||
<?php _e('All Templates', 'wp-multisite-waas'); ?>
|
||||
|
||||
</option>
|
||||
|
||||
<?php if ( ! empty($customer_sites)) : ?>
|
||||
|
||||
<option value="<?php echo esc_attr($customer_sites_category); ?>">
|
||||
|
||||
<?php echo $customer_sites_category; ?>
|
||||
|
||||
</option>
|
||||
</h2>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php foreach ($categories as $category) : ?>
|
||||
<div class="wp-filter">
|
||||
|
||||
<option value="<?php echo esc_attr($category); ?>">
|
||||
|
||||
<?php echo $category; ?>
|
||||
|
||||
</option>
|
||||
<div class="wp-filter-responsive">
|
||||
|
||||
<?php endforeach; ?>
|
||||
<h4><?php esc_html_e('Template Categories', 'wp-multisite-waas'); ?></h4>
|
||||
|
||||
</select>
|
||||
<select class="">
|
||||
|
||||
</div>
|
||||
<option value="">
|
||||
|
||||
<ul class="filter-links wp-filter-template">
|
||||
<?php esc_html_e('All Templates', 'wp-multisite-waas'); ?>
|
||||
|
||||
<li class="selector-inactive">
|
||||
</option>
|
||||
|
||||
<a
|
||||
href="#"
|
||||
data-category=""
|
||||
:class="$parent.template_category === '' ? 'current' : ''"
|
||||
v-on:click.prevent="$parent.template_category = ''"
|
||||
>
|
||||
|
||||
<?php _e('All Templates', 'wp-multisite-waas'); ?>
|
||||
|
||||
</a>
|
||||
<?php if ( ! empty($customer_sites) ) : ?>
|
||||
|
||||
</li>
|
||||
<option value="<?php echo esc_attr($customer_sites_category); ?>">
|
||||
|
||||
<?php if ( ! empty($customer_sites)) : ?>
|
||||
|
||||
<li class="selector-inactive">
|
||||
<?php echo esc_html($customer_sites_category); ?>
|
||||
|
||||
<a
|
||||
href="#"
|
||||
data-category="<?php echo esc_attr($customer_sites_category); ?>"
|
||||
:class="$parent.template_category === '<?php echo esc_attr($customer_sites_category); ?>' ? 'current' : ''"
|
||||
v-on:click.prevent="$parent.template_category = '<?php echo esc_attr($customer_sites_category); ?>'"
|
||||
>
|
||||
|
||||
<?php echo $customer_sites_category; ?>
|
||||
|
||||
</a>
|
||||
</option>
|
||||
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
<?php foreach ( $categories as $category ) : ?>
|
||||
|
||||
<?php foreach ($categories as $category) : ?>
|
||||
<option value="<?php echo esc_attr($category); ?>">
|
||||
|
||||
<li class="selector-inactive">
|
||||
|
||||
<a
|
||||
href="#"
|
||||
data-category="<?php echo esc_attr($category); ?>"
|
||||
:class="$parent.template_category === '<?php echo esc_attr($category); ?>' ? 'current' : ''"
|
||||
v-on:click.prevent="$parent.template_category = '<?php echo esc_attr($category); ?>'"
|
||||
>
|
||||
|
||||
<?php echo $category; ?>
|
||||
|
||||
</a>
|
||||
<?php echo esc_html($category); ?>
|
||||
|
||||
</li>
|
||||
</option>
|
||||
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
|
||||
</ul>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="theme-browser rendered">
|
||||
<ul class="filter-links wp-filter-template">
|
||||
|
||||
<div class="wu-grid wu-grid-cols-1 sm:wu-grid-cols-2 md:wu-grid-cols-<?php echo $cols; ?> wu-gap-4 wp-clearfix">
|
||||
<li class="selector-inactive">
|
||||
|
||||
<?php $i = 0; foreach ($sites as $site) : ?>
|
||||
<a
|
||||
href="#"
|
||||
data-category=""
|
||||
:class="$parent.template_category === '' ? 'current' : ''"
|
||||
v-on:click.prevent="$parent.template_category = ''"
|
||||
>
|
||||
|
||||
<?php
|
||||
if ($site->get_type() !== 'site_template' && ! in_array($site->get_id(), $customer_sites, true)) {
|
||||
continue; }
|
||||
?>
|
||||
<?php esc_html_e('All Templates', 'wp-multisite-waas'); ?>
|
||||
|
||||
<?php $is_template = $site->get_type() === 'site_template'; ?>
|
||||
</a>
|
||||
|
||||
<?php $categories = array_merge($site->get_categories(), ! $is_template ? [$customer_sites_category] : []); ?>
|
||||
</li>
|
||||
|
||||
<div
|
||||
class="theme"
|
||||
tabindex="<?php echo $i; ?>"
|
||||
aria-describedby="<?php echo $site->get_id(); ?>-action <?php echo $site->get_id(); ?>-name"
|
||||
data-slug="<?php echo $site->get_id(); ?>"
|
||||
v-show="!$parent.template_category || <?php echo esc_attr(json_encode($categories)); ?>.join(',').indexOf($parent.template_category) > -1"
|
||||
v-cloak
|
||||
>
|
||||
<?php if ( ! empty($customer_sites) ) : ?>
|
||||
|
||||
<div class="theme-screenshot">
|
||||
<li class="selector-inactive">
|
||||
|
||||
<img
|
||||
src="<?php echo $site->get_featured_image(); ?>"
|
||||
alt="<?php echo $site->get_title(); ?>"
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
data-category="<?php echo esc_attr($customer_sites_category); ?>"
|
||||
:class="$parent.template_category === '<?php echo esc_attr($customer_sites_category); ?>' ? 'current' : ''"
|
||||
v-on:click.prevent="$parent.template_category = '<?php echo esc_attr($customer_sites_category); ?>'"
|
||||
>
|
||||
|
||||
|
||||
<?php echo esc_html($customer_sites_category); ?>
|
||||
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php foreach ( $categories as $category ) : ?>
|
||||
|
||||
<li class="selector-inactive">
|
||||
|
||||
<a
|
||||
href="#"
|
||||
data-category="<?php echo esc_attr($category); ?>"
|
||||
:class="$parent.template_category === '<?php echo esc_attr($category); ?>' ? 'current' : ''"
|
||||
v-on:click.prevent="$parent.template_category = '<?php echo esc_attr($category); ?>'"
|
||||
>
|
||||
|
||||
|
||||
<?php echo esc_html($category); ?>
|
||||
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<a
|
||||
<?php echo $is_template ? $site->get_preview_url_attrs() : sprintf('href="%s" target="_blank"', $site->get_active_site_url()); ?>
|
||||
class="more-details"
|
||||
id="<?php echo $site->get_id(); ?>-action"
|
||||
>
|
||||
<div class="theme-browser rendered">
|
||||
|
||||
<?php $is_template ? _e('View Template', 'wp-multisite-waas') : _e('View Site', 'wp-multisite-waas'); ?>
|
||||
|
||||
</a>
|
||||
<div class="wu-grid wu-grid-cols-1 sm:wu-grid-cols-2 md:wu-grid-cols-<?php echo esc_attr($cols); ?> wu-gap-4 wp-clearfix">
|
||||
|
||||
<div class="wu-flex theme-name-header wu-items-center wu-relative">
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ( $sites as $site ) :
|
||||
?>
|
||||
|
||||
<h2 class="theme-name wu-flex-grow wu-h-full" id="<?php echo $site->get_id(); ?>-name">
|
||||
<?php
|
||||
if ( $site->get_type() !== 'site_template' && ! in_array($site->get_id(), $customer_sites, true) ) {
|
||||
continue;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php echo $site->get_title(); ?>
|
||||
|
||||
</h2>
|
||||
<?php $is_template = $site->get_type() === 'site_template'; ?>
|
||||
|
||||
<div class="theme-actions wu-flex">
|
||||
<?php $categories = array_merge($site->get_categories(), ! $is_template ? [$customer_sites_category] : []); ?>
|
||||
|
||||
<button
|
||||
class="button button-primary"
|
||||
type="button"
|
||||
v-on:click.prevent="$parent.template_id = <?php echo esc_attr($site->get_id()); ?>"
|
||||
>
|
||||
<div
|
||||
class="theme"
|
||||
tabindex="<?php echo esc_attr($i); ?>"
|
||||
aria-describedby="<?php echo esc_attr($site->get_id()); ?>-action <?php echo esc_attr($site->get_id()); ?>-name"
|
||||
data-slug="<?php echo esc_attr($site->get_id()); ?>"
|
||||
v-show="!$parent.template_category || <?php echo esc_attr(wp_json_encode($categories)); ?>.join(',').indexOf($parent.template_category) > -1"
|
||||
v-cloak
|
||||
>
|
||||
|
||||
<span v-if="$parent.template_id == <?php echo esc_attr($site->get_id()); ?>"><?php _e('Selected', 'wp-multisite-waas'); ?></span>
|
||||
<div class="theme-screenshot">
|
||||
|
||||
<span v-else><?php _e('Select', 'wp-multisite-waas'); ?></span>
|
||||
<img
|
||||
src="<?php echo esc_url($site->get_featured_image()); ?>"
|
||||
alt="<?php echo esc_attr($site->get_title()); ?>"
|
||||
>
|
||||
</div>
|
||||
|
||||
</button>
|
||||
<a
|
||||
<?php echo $is_template ? $site->get_preview_url_attrs() : sprintf('href="%s" target="_blank"', $site->get_active_site_url()); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
class="more-details"
|
||||
id="<?php echo esc_attr($site->get_id()); ?>-action"
|
||||
>
|
||||
<?php $is_template ? esc_html_e('View Template', 'wp-multisite-waas') : esc_html_e('View Site', 'wp-multisite-waas'); ?>
|
||||
</a>
|
||||
|
||||
<div class="wu-flex theme-name-header wu-items-center wu-relative">
|
||||
|
||||
|
||||
<h2 class="theme-name wu-flex-grow wu-h-full"
|
||||
id="<?php echo esc_attr($site->get_id()); ?>-name">
|
||||
<?php echo esc_html($site->get_title()); ?>
|
||||
</h2>
|
||||
|
||||
<div class="theme-actions wu-flex">
|
||||
|
||||
<button
|
||||
class="button button-primary"
|
||||
type="button"
|
||||
v-on:click.prevent="$parent.template_id = <?php echo esc_attr($site->get_id()); ?>"
|
||||
>
|
||||
|
||||
<span v-if="$parent.template_id == <?php echo esc_attr($site->get_id()); ?>"><?php esc_html_e('Selected', 'wp-multisite-waas'); ?></span>
|
||||
|
||||
<span v-else><?php esc_html_e('Select', 'wp-multisite-waas'); ?></span>
|
||||
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
++$i;
|
||||
endforeach;
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="theme-overlay"></div>
|
||||
|
||||
<?php
|
||||
|
||||
++$i;
|
||||
endforeach;
|
||||
|
||||
?>
|
||||
<p class="no-themes">
|
||||
<?php esc_html_e('No Templates Found', 'wp-multisite-waas'); ?>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="theme-overlay"></div>
|
||||
|
||||
<p class="no-themes">
|
||||
|
||||
<?php _e('No Templates Found', 'wp-multisite-waas'); ?>
|
||||
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
@ -20,8 +20,7 @@ defined('ABSPATH') || exit;
|
||||
|
||||
if ( ! $should_display) {
|
||||
return;
|
||||
} // end if;
|
||||
|
||||
}
|
||||
$sites = array_map('wu_get_site', $sites ?? []);
|
||||
|
||||
$categories ??= [];
|
||||
@ -35,107 +34,103 @@ $customer_sites = isset($customer_sites) ? array_map('intval', $customer_sites)
|
||||
|
||||
<ul id="wu-site-template-filter">
|
||||
|
||||
<li class="wu-site-template-filter-all">
|
||||
<a
|
||||
href="#"
|
||||
data-category=""
|
||||
:class="$parent.template_category === '' ? 'current wu-font-semibold' : ''"
|
||||
v-on:click.prevent="$parent.template_category = ''"
|
||||
>
|
||||
<?php _e('All', 'wp-multisite-waas'); ?>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php if ( ! empty($customer_sites)) : ?>
|
||||
|
||||
<li class="wu-site-template-filter-<?php echo esc_attr(sanitize_title($customer_sites_category)); ?>">
|
||||
<a
|
||||
href="#"
|
||||
data-category="<?php echo esc_attr($customer_sites_category); ?>"
|
||||
:class="$parent.template_category === '<?php echo esc_attr($customer_sites_category); ?>' ? 'current wu-font-semibold' : ''"
|
||||
v-on:click.prevent="$parent.template_category = '<?php echo esc_attr($customer_sites_category); ?>'"
|
||||
><?php echo $customer_sites_category; ?></a>
|
||||
</li>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (isset($categories) && $categories) : ?>
|
||||
|
||||
<?php foreach ($categories as $category) : ?>
|
||||
|
||||
<li class="wu-site-template-filter-<?php echo esc_attr(sanitize_title($category)); ?>">
|
||||
<li class="wu-site-template-filter-all">
|
||||
<a
|
||||
href="#"
|
||||
data-category="<?php echo esc_attr($category); ?>"
|
||||
:class="$parent.template_category === '<?php echo esc_attr($category); ?>' ? 'current wu-font-semibold' : ''"
|
||||
v-on:click.prevent="$parent.template_category = '<?php echo esc_attr($category); ?>'"
|
||||
><?php echo $category; ?></a>
|
||||
href="#"
|
||||
data-category=""
|
||||
:class="$parent.template_category === '' ? 'current wu-font-semibold' : ''"
|
||||
v-on:click.prevent="$parent.template_category = ''"
|
||||
>
|
||||
<?php esc_html_e('All', 'wp-multisite-waas'); ?>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php endforeach; ?>
|
||||
<?php if ( ! empty($customer_sites)) : ?>
|
||||
|
||||
<?php endif; ?>
|
||||
<li class="wu-site-template-filter-<?php echo esc_attr(sanitize_title($customer_sites_category)); ?>">
|
||||
<a
|
||||
href="#"
|
||||
data-category="<?php echo esc_attr($customer_sites_category); ?>"
|
||||
:class="$parent.template_category === '<?php echo esc_attr($customer_sites_category); ?>' ? 'current wu-font-semibold' : ''"
|
||||
v-on:click.prevent="$parent.template_category = '<?php echo esc_attr($customer_sites_category); ?>'"
|
||||
>
|
||||
<?php echo esc_html($customer_sites_category); ?></a>
|
||||
</li>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (isset($categories) && $categories) : ?>
|
||||
|
||||
<?php foreach ($categories as $category) : ?>
|
||||
|
||||
<li class="wu-site-template-filter-<?php echo esc_attr(sanitize_title($category)); ?>">
|
||||
<a
|
||||
href="#"
|
||||
data-category="<?php echo esc_attr($category); ?>"
|
||||
:class="$parent.template_category === '<?php echo esc_attr($category); ?>' ? 'current wu-font-semibold' : ''"
|
||||
v-on:click.prevent="$parent.template_category = '<?php echo esc_attr($category); ?>'"
|
||||
>
|
||||
<?php echo esc_html($category); ?></a>
|
||||
</li>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</ul>
|
||||
|
||||
<div id="wu-site-template-container-grid">
|
||||
|
||||
<?php foreach ($sites as $site_template) : ?>
|
||||
<?php foreach ($sites as $site_template) : ?>
|
||||
|
||||
<?php
|
||||
if ($site_template->get_type() !== 'site_template' && ! in_array($site_template->get_id(), $customer_sites, true)) {
|
||||
continue; }
|
||||
?>
|
||||
<?php
|
||||
if ($site_template->get_type() !== 'site_template' && ! in_array($site_template->get_id(), $customer_sites, true)) {
|
||||
continue; }
|
||||
?>
|
||||
|
||||
<?php $is_template = $site_template->get_type() === 'site_template'; ?>
|
||||
<?php $is_template = $site_template->get_type() === 'site_template'; ?>
|
||||
|
||||
<?php $categories = array_merge($site_template->get_categories(), ! $is_template ? [$customer_sites_category] : []); ?>
|
||||
<?php $categories = array_merge($site_template->get_categories(), ! $is_template ? [$customer_sites_category] : []); ?>
|
||||
|
||||
<div
|
||||
id="wu-site-template-<?php echo esc_attr($site_template->get_id()); ?>"
|
||||
v-show="!$parent.template_category || <?php echo esc_attr(json_encode($categories)); ?>.join(',').indexOf($parent.template_category) > -1"
|
||||
v-cloak
|
||||
>
|
||||
<div
|
||||
id="wu-site-template-<?php echo esc_attr($site_template->get_id()); ?>"
|
||||
v-show="!$parent.template_category || <?php echo esc_attr(wp_json_encode($categories)); ?>.join(',').indexOf($parent.template_category) > -1"
|
||||
v-cloak
|
||||
>
|
||||
|
||||
<img class="wu-site-template-image" src="<?php echo esc_attr($site_template->get_featured_image()); ?>" alt="<?php echo $site_template->get_title(); ?>">
|
||||
<img class="wu-site-template-image" src="<?php echo esc_attr($site_template->get_featured_image()); ?>" alt="<?php echo esc_attr($site_template->get_title()); ?>">
|
||||
|
||||
<h3 class="wu-site-template-title">
|
||||
<h3 class="wu-site-template-title">
|
||||
<?php echo esc_html($site_template->get_title()); ?>
|
||||
</h3>
|
||||
|
||||
<?php echo $site_template->get_title(); ?>
|
||||
<p class="wu-site-template-description">
|
||||
<?php echo esc_html($site_template->get_description()); ?>
|
||||
</p>
|
||||
|
||||
</h3>
|
||||
<div class="wu-site-template-preview-block">
|
||||
|
||||
<p class="wu-site-template-description">
|
||||
<a class="wu-site-template-selector" <?php echo $site_template->get_preview_url_attrs(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<?php esc_html_e('View Template Preview', 'wp-multisite-waas'); ?>
|
||||
</a>
|
||||
|
||||
<?php echo $site_template->get_description(); ?>
|
||||
</div>
|
||||
|
||||
</p>
|
||||
<label for="wu-site-template-id-<?php echo esc_attr($site_template->get_id()); ?>">
|
||||
|
||||
<div class="wu-site-template-preview-block">
|
||||
<input id="wu-site-template-id-<?php echo esc_attr($site_template->get_id()); ?>" type="radio" name="template_id" v-model="$parent.template_id" value="<?php echo esc_attr($site_template->get_id()); ?>" />
|
||||
|
||||
<a class="wu-site-template-selector" <?php echo $site_template->get_preview_url_attrs(); ?>>
|
||||
<a class="wu-site-template-selector" @click.prevent="" href="#">
|
||||
|
||||
<?php _e('View Template Preview', 'wp-multisite-waas'); ?>
|
||||
<?php esc_html_e('Select this Template', 'wp-multisite-waas'); ?>
|
||||
|
||||
</a>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</label>
|
||||
|
||||
<label for="wu-site-template-id-<?php echo esc_attr($site_template->get_id()); ?>">
|
||||
</div>
|
||||
|
||||
<input id="wu-site-template-id-<?php echo esc_attr($site_template->get_id()); ?>" type="radio" name="template_id" v-model="$parent.template_id" value="<?php echo esc_attr($site_template->get_id()); ?>" />
|
||||
|
||||
<a class="wu-site-template-selector" @click.prevent="" href="#">
|
||||
|
||||
<?php _e('Select this Template', 'wp-multisite-waas'); ?>
|
||||
|
||||
</a>
|
||||
|
||||
</label>
|
||||
|
||||
</div>
|
||||
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
|
||||
</div>
|
||||
|
||||
|
Reference in New Issue
Block a user