# age-gate/3.7.3/src/Resources/views/admin/partials/fields/image.php

Age Gate, version 3.7.3. 17 lines.

- Page: https://pluginprobe.com/plugins/age-gate/3.7.3/code/src/Resources/views/admin/partials/fields/image.php
- Raw: https://pluginprobe.com/plugins/age-gate/3.7.3/raw/src/Resources/views/admin/partials/fields/image.php
- Modified: 2025-03-27T08:14:32+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/age-gate/3.7.3/code/src/Resources/views/admin/partials/fields/image.php#L10-L20`.

```php
<?php $this->layout('partials/fields/wrapper', ['field' => $field, 'lang' => $lang ?? false]) ?>

<?php $this->start('input') ?>
    <div class="ag-preview"><?php if ($data[$name] ?? false) : ?>
            <?php if (strpos(get_post_mime_type($data[$name]), 'video') !== false) : ?>
                <video controls src="<?php echo esc_url(wp_get_attachment_url($data[$name])); ?>"></video>
            <?php else: ?>
                <img src="<?php echo esc_url(wp_get_attachment_url($data[$name])); ?>" /> <?php // phpcs:ignore PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage ?>
            <?php endif; ?>
        <?php endif; ?>
    </div>
    <input type="hidden" name="<?php echo esc_attr($this->form_key($field_prefix . '.' . $name)) ?>" value="<?php echo esc_attr($data[$name] ?? (!empty($lang) ? '' : $field['default'] ?? '')) ?>" <?php echo html_build_attributes($field['attributes'] ?? []) ?> /><?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
    <button type="button" class="button ag-media-clear"><?php echo esc_html__('Remove', 'age-gate') ?></button>
    <button type="button" class="button js-modal" data-modal="ag-media"><?php echo esc_html__('Select image', 'age-gate') ?></button>
<?php $this->stop(); ?>


```
