| 1 |
<?php if ($errors) : ?> |
| 2 |
|
| 3 |
<div <?php echo $this->attr('age-gate-errors') ?>><?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 4 |
|
| 5 |
<?php |
| 6 |
$key = array_key_last($errors); |
| 7 |
$error = end($errors); |
| 8 |
?> |
| 9 |
<p <?php echo $this->attr('age-gate-error') ?>><?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 10 |
<?php echo $this->mdLine(esc_html(apply_filters('age_gate/error/' . $key, $error))) ?><?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 11 |
</p> |
| 12 |
|
| 13 |
</div> |
| 14 |
<?php endif; ?> |
| 15 |
<?php if (is_customize_preview()) : ?> |
| 16 |
<div <?php echo $this->attr('age-gate-errors') ?>><?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 17 |
<p <?php echo $this->attr('age-gate-error') ?>><?php echo esc_html(apply_filters('age_gate/error/demo', __('Demonstration error message', 'age-gate'))) ?></p><?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 18 |
</div> |
| 19 |
<?php endif; ?> |
| 20 |
<?php if ($settings->method === 'js') : ?> |
| 21 |
<div <?php echo $this->attr('age-gate-errors') ?>></div><?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 22 |
<?php endif ?> |
| 23 |
|