/var/www/html/wp-content/plugins/yith-woocommerce-compare/plugin-fw/templates/fields/slider.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/**
 * Template for displaying the slider field
 *
 * @var array $field The field.
 * @package YITH\PluginFramework\Templates\Fields
 */

defined'ABSPATH' ) || exit; // Exit if accessed directly.

list ( $field_id$class$name$value,
    
/**
     * Array of option containing min and max value
     * This is deprecated since 3.5 | use 'min' and 'max' instead.
     */
    
$option,
    
$min$max$step$custom_attributes$data ) = yith_plugin_fw_extract$field'id''class''name''value''option''min''max''step''custom_attributes''data' );

// Handle the deprecated attribute 'option': use 'min' and 'max' instead.
if ( ! isset( $min ) && isset( $option$option['min'] ) ) {
    
$min $option['min'];
}

if ( ! isset( 
$max ) && isset( $option$option['max'] ) ) {
    
$max $option['max'];
}

$min  = isset( $min ) ? $min 0;
$max  = isset( $max ) ? $max 100;
$step = isset( $step ) ? $step 1;
?>
<div class="yith-plugin-fw-slider-container <?php echo ! empty( $class ) ? esc_attr$class ) : ''?>">
    <div class="ui-slider">
        <span class="minCaption"><?php echo esc_html$min ); ?></span>
        <div id="<?php echo esc_attr$field_id ); ?>-div"
                class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all"
                data-step="<?php echo esc_attr$step ); ?>"
                data-min="<?php echo esc_attr$min ); ?>"
                data-max="<?php echo esc_attr$max ); ?>"
                data-val="<?php echo esc_attr$value ); ?>"

            <?php yith_plugin_fw_html_attributes_to_string$custom_attributestrue ); ?>
            <?php yith_plugin_fw_html_data_to_string$datatrue ); ?>
        >
            <input id="<?php echo esc_attr$field_id ); ?>"
                    type="hidden"
                    name="<?php echo esc_attr$name ); ?>"
                    value="<?php echo esc_attr$value ); ?>"
            />
        </div>
        <span class="maxCaption"><?php echo esc_html$max ); ?></span>
    </div>
</div>