resources
4 years ago
ajax-customers.php
4 years ago
ajax-orders.php
3 years ago
ajax-posts.php
4 years ago
ajax-products.php
4 years ago
ajax-terms.php
4 years ago
buttons.php
5 years ago
checkbox-array.php
4 years ago
checkbox.php
4 years ago
colorpicker.php
4 years ago
copy-to-clipboard.php
4 years ago
country-select.php
4 years ago
custom.php
5 years ago
customtabs.php
5 years ago
date-format.php
4 years ago
datepicker.php
4 years ago
dimensions.php
4 years ago
email.php
4 years ago
file.php
3 years ago
hidden.php
4 years ago
html.php
5 years ago
icons.php
4 years ago
image-dimensions.php
4 years ago
image-gallery.php
2 years ago
inline-fields.php
4 years ago
list-table.php
4 years ago
media.php
1 year ago
multi-colorpicker.php
5 years ago
multi-select.php
3 years ago
number.php
4 years ago
onoff.php
3 years ago
password.php
4 years ago
preview.php
4 years ago
radio.php
2 years ago
select-buttons.php
4 years ago
select-images.php
3 years ago
select-mailchimp.php
4 years ago
select.php
4 years ago
sep.php
5 years ago
sidebarlist.php
4 years ago
sidebars.php
5 years ago
simple-text.php
4 years ago
slider.php
4 years ago
text-array.php
3 years ago
text-button.php
4 years ago
text.php
4 years ago
textarea-codemirror.php
4 years ago
textarea-editor.php
4 years ago
textarea.php
4 years ago
title.php
4 years ago
toggle-element-fixed.php
1 year ago
toggle-element.php
2 years ago
upload.php
4 years ago
file.php
43 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Template for displaying the File field |
| 4 | * |
| 5 | * @var array $field The field. |
| 6 | * @package YITH\PluginFramework\Templates\Fields |
| 7 | */ |
| 8 | |
| 9 | defined( 'ABSPATH' ) || exit; // Exit if accessed directly. |
| 10 | |
| 11 | list ( $field_id, $class, $name, $message, $custom_attributes, $data ) = yith_plugin_fw_extract( $field, 'id', 'class', 'name', 'message', 'custom_attributes', 'data' ); |
| 12 | |
| 13 | |
| 14 | $message = $message ?? __( 'Drag or upload a file.', 'yith-plugin-fw' ); |
| 15 | |
| 16 | $classes = array( |
| 17 | 'yith-plugin-fw-file', |
| 18 | $class, |
| 19 | ); |
| 20 | |
| 21 | $classes = implode( ' ', array_filter( $classes ) ); |
| 22 | ?> |
| 23 | <div class="<?php echo esc_attr( $classes ); ?>"> |
| 24 | <input |
| 25 | type="file" |
| 26 | id="<?php echo esc_attr( $field_id ); ?>" |
| 27 | name="<?php echo esc_attr( $name ); ?>" |
| 28 | class="yith-plugin-fw-file__field" |
| 29 | <?php yith_plugin_fw_html_attributes_to_string( $custom_attributes, true ); ?> |
| 30 | <?php yith_plugin_fw_html_data_to_string( $data, true ); ?> |
| 31 | /> |
| 32 | <div class="yith-plugin-fw-file__message"> |
| 33 | <?php echo wp_kses_post( $message ); ?> |
| 34 | </div> |
| 35 | |
| 36 | <div class="yith-plugin-fw-file__preview"> |
| 37 | <svg class="yith-plugin-fw-file__preview__icon" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"> |
| 38 | <path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"></path> |
| 39 | </svg> |
| 40 | <span class="yith-plugin-fw-file__preview__name"></span> |
| 41 | </div> |
| 42 | </div> |
| 43 |