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
onoff.php
43 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Template for displaying the onoff 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, $std, $value, $custom_attributes, $data, $desc_inline ) = yith_plugin_fw_extract( $field, 'id', 'class', 'name', 'std', 'value', 'custom_attributes', 'data', 'desc-inline' ); |
| 12 | |
| 13 | ?> |
| 14 | <div class="yith-plugin-fw-onoff-container <?php echo ! empty( $class ) ? esc_attr( $class ) : ''; ?>" |
| 15 | <?php yith_plugin_fw_html_data_to_string( $data, true ); ?> |
| 16 | > |
| 17 | <input type="checkbox" id="<?php echo esc_attr( $field_id ); ?>" |
| 18 | class="on_off" |
| 19 | name="<?php echo esc_attr( $name ); ?>" |
| 20 | value="<?php echo esc_attr( $value ); ?>" |
| 21 | <?php if ( isset( $std ) ) : ?> |
| 22 | data-std="<?php echo esc_attr( $std ); ?>" |
| 23 | <?php endif; ?> |
| 24 | <?php checked( true, yith_plugin_fw_is_true( $value ) ); ?> |
| 25 | <?php yith_plugin_fw_html_attributes_to_string( $custom_attributes, true ); ?> |
| 26 | /> |
| 27 | <span class="yith-plugin-fw-onoff"> |
| 28 | <span class="yith-plugin-fw-onoff__handle"> |
| 29 | <svg class="yith-plugin-fw-onoff__icon yith-plugin-fw-onoff__icon--on" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" role="img"> |
| 30 | <path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd"></path> |
| 31 | </svg> |
| 32 | <svg class="yith-plugin-fw-onoff__icon yith-plugin-fw-onoff__icon--off" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" role="img"> |
| 33 | <path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"></path> |
| 34 | </svg> |
| 35 | </span> |
| 36 | <span class="yith-plugin-fw-onoff__zero-width-space notranslate">​</span> |
| 37 | </span> |
| 38 | </div> |
| 39 | |
| 40 | <?php if ( isset( $desc_inline ) ) : ?> |
| 41 | <span class='description inline'><?php echo wp_kses_post( $desc_inline ); ?></span> |
| 42 | <?php endif; ?> |
| 43 |