PluginProbe
Age Gate / 3.7.3
Age Gate v3.7.3
3.7.3 trunk 1.0.0 1.0.1 1.1.0 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 1.4.13 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 All 113 releases
age-gate / src / Resources / views / admin / partials / fields / image.php

image.php in Age Gate 3.7.3, at src/Resources/views/admin/partials/fields/image.php

17 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php $this->layout('partials/fields/wrapper', ['field' => $field, 'lang' => $lang ?? false]) ?>
2
3 <?php $this->start('input') ?>
4 <div class="ag-preview"><?php if ($data[$name] ?? false) : ?>
5 <?php if (strpos(get_post_mime_type($data[$name]), 'video') !== false) : ?>
6 <video controls src="<?php echo esc_url(wp_get_attachment_url($data[$name])); ?>"></video>
7 <?php else: ?>
8 <img src="<?php echo esc_url(wp_get_attachment_url($data[$name])); ?>" /> <?php // phpcs:ignore PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage ?>
9 <?php endif; ?>
10 <?php endif; ?>
11 </div>
12 <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 ?>
13 <button type="button" class="button ag-media-clear"><?php echo esc_html__('Remove', 'age-gate') ?></button>
14 <button type="button" class="button js-modal" data-modal="ag-media"><?php echo esc_html__('Select image', 'age-gate') ?></button>
15 <?php $this->stop(); ?>
16
17