| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package FirePlugins Framework |
| 4 |
* @version 1.2.6 |
| 5 |
* |
| 6 |
* @author FirePlugins <[email protected]> |
| 7 |
* @link https://www.fireplugins.com |
| 8 |
* @copyright Copyright © 2026 FirePlugins All Rights Reserved |
| 9 |
* @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later |
| 10 |
*/ |
| 11 |
|
| 12 |
if (!defined('ABSPATH')) |
| 13 |
{ |
| 14 |
exit; // Exit if accessed directly. |
| 15 |
} |
| 16 |
|
| 17 |
if (!$this->data->get('readonly') && !$this->data->get('disabled')) |
| 18 |
{ |
| 19 |
wp_register_script( |
| 20 |
'fpframework-slider-widget', |
| 21 |
FPF_MEDIA_URL . 'public/js/widgets/slider.js', |
| 22 |
[], |
| 23 |
FPF_VERSION, |
| 24 |
true |
| 25 |
); |
| 26 |
wp_enqueue_script('fpframework-slider-widget'); |
| 27 |
} |
| 28 |
|
| 29 |
if ($this->data->get('load_stylesheet')) |
| 30 |
{ |
| 31 |
wp_register_style( |
| 32 |
'fpframework-slider-widget', |
| 33 |
FPF_MEDIA_URL . 'public/css/widgets/slider.css', |
| 34 |
[], |
| 35 |
FPF_VERSION, |
| 36 |
false |
| 37 |
); |
| 38 |
wp_enqueue_style('fpframework-slider-widget'); |
| 39 |
} |
| 40 |
|
| 41 |
if ($this->data->get('load_css_vars')) |
| 42 |
{ |
| 43 |
wp_add_inline_style('fpframework-slider-widget', ' |
| 44 |
.fpf-slider-wrapper.' . esc_attr($this->data->get('id')) . ' { |
| 45 |
--base-color: ' . esc_attr($this->data->get('base_color')) . '; |
| 46 |
--progress-color: ' . esc_attr($this->data->get('color')) . '; |
| 47 |
--input-bg-color: ' . esc_attr($this->data->get('input_bg_color')) . '; |
| 48 |
--input-border-color: ' . esc_attr($this->data->get('input_border_color')) . '; |
| 49 |
--thumb-shadow-color: ' . esc_attr($this->data->get('color')) . '26' . '; |
| 50 |
} |
| 51 |
'); |
| 52 |
} |
| 53 |
?> |
| 54 |
<div class="fpf-widget fpf-slider-wrapper<?php echo esc_attr($this->data->get('css_class')); ?>"> |
| 55 |
<input |
| 56 |
type="range" |
| 57 |
class="fpf-slider-range" |
| 58 |
min="<?php echo esc_attr($this->data->get('min')); ?>" |
| 59 |
max="<?php echo esc_attr($this->data->get('max')); ?>" |
| 60 |
step="<?php echo esc_attr($this->data->get('step')); ?>" |
| 61 |
value="<?php echo esc_attr($this->data->get('value')); ?>" |
| 62 |
<?php if ($load_css_vars): ?> |
| 63 |
data-base-color="<?php echo esc_attr($this->data->get('base_color')); ?>" |
| 64 |
data-progress-color="<?php echo esc_attr($this->data->get('color')); ?>" |
| 65 |
style="background: linear-gradient(to right, <?php echo esc_attr($this->data->get('color')); ?> 0%, <?php echo esc_attr($this->data->get('color')) . ' ' . esc_attr($this->data->get('bar_percentage')); ?>%, <?php echo esc_attr($this->data->get('base_color')) . ' ' . esc_attr($this->data->get('bar_percentage')); ?>%, <?php echo esc_attr($this->data->get('base_color')); ?> 100%)" |
| 66 |
<?php endif; ?> |
| 67 |
<?php if ($this->data->get('readonly') || $this->data->get('disabled')): ?> |
| 68 |
disabled |
| 69 |
<?php endif; ?> |
| 70 |
/> |
| 71 |
<input |
| 72 |
type="number" |
| 73 |
value="<?php echo esc_attr($this->data->get('value')); ?>" |
| 74 |
id="<?php echo esc_attr($this->data->get('id')); ?>" |
| 75 |
name="<?php echo esc_attr($this->data->get('name')); ?>" |
| 76 |
min="<?php echo esc_attr($this->data->get('min')); ?>" |
| 77 |
max="<?php echo esc_attr($this->data->get('max')); ?>" |
| 78 |
step="<?php echo esc_attr($this->data->get('step')); ?>" |
| 79 |
class="fpf-slider-value <?php echo esc_attr($this->data->get('input_class')); ?>" |
| 80 |
<?php if ($this->data->get('readonly') || $this->data->get('disabled')): ?> |
| 81 |
readonly |
| 82 |
<?php endif; ?> |
| 83 |
/> |
| 84 |
</div> |