| Server IP : 198.54.126.161 / Your IP : 216.73.216.232 Web Server : LiteSpeed System : Linux premium12.web-hosting.com 4.18.0-553.94.1.lve.el8.x86_64 #1 SMP Thu Jan 22 12:37:22 UTC 2026 x86_64 User : amerfigf ( 898) PHP Version : 8.2.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/cwd/wp-content/plugins/WP-FormBuilder/admin/classes/fields/ |
Upload File : |
<?php
defined('ABSPATH') || die();
class HashFormFieldImage extends HashFormFieldType {
protected $type = 'image';
public function field_settings_for_type() {
return array(
'label' => false,
'default' => false,
'description' => false,
'required' => false,
'image' => true,
'field_alignment' => true,
);
}
protected function extra_field_default_opts() {
return array(
'image_id' => '',
'field_alignment' => 'left',
);
}
protected function input_html() {
$field = $this->get_field();
$image = '';
if (isset($field['image_id'])) {
$image = wp_get_attachment_image_src($field['image_id'], 'full');
$image = isset($image[0]) ? $image[0] : '';
}
$image_class = $image ? 'hf-hidden' : '';
?>
<div class="hf-image-preview-front hf-field-image-<?php echo esc_attr($field['id']); ?>">
<div class="hf-no-image-field <?php echo esc_attr($image_class); ?>">
<?php esc_html_e('Image Field - No Image', 'hash-form'); ?>
</div>
<?php
if ($image) {
?>
<img src="<?php echo esc_url($image); ?>"/>
<?php
}
?>
</div>
<?php
}
}