| 1 |
<?php |
| 2 |
/** |
| 3 |
* Template: Range field. |
| 4 |
* |
| 5 |
* @var array<string, mixed> $settings Field configuration. |
| 6 |
* @var mixed $value Current saved value. |
| 7 |
* @var string $module_id Module ID. |
| 8 |
* |
| 9 |
* @package Merchant |
| 10 |
* @since 2.2.5 |
| 11 |
*/ |
| 12 |
|
| 13 |
if ( ! defined( 'ABSPATH' ) ) { |
| 14 |
exit; |
| 15 |
} |
| 16 |
|
| 17 |
$settings = wp_parse_args( $settings, array( |
| 18 |
'min' => '', |
| 19 |
'max' => '', |
| 20 |
'step' => '', |
| 21 |
'unit' => '', |
| 22 |
) ); |
| 23 |
?> |
| 24 |
<div class="merchant-range"> |
| 25 |
<input type="range" class="merchant-range-input" name="" min="<?php echo esc_attr( $settings['min'] ); ?>" max="<?php echo esc_attr( $settings['max'] ); ?>" |
| 26 |
step="<?php echo esc_attr( $settings['step'] ); ?>" value="<?php echo esc_attr( $value ); ?>"/> |
| 27 |
<input type="number" class="merchant-range-number-input" name="merchant[<?php echo esc_attr( $settings['id'] ); ?>]" min="<?php echo esc_attr( $settings['min'] ); ?>" |
| 28 |
max="<?php echo esc_attr( $settings['max'] ); ?>" step="<?php echo esc_attr( $settings['step'] ); ?>" value="<?php echo esc_attr( $value ); ?>"/> |
| 29 |
<?php if ( ! empty( $settings['unit'] ) ) : ?> |
| 30 |
<span class="merchant-range-unit"><?php echo esc_html( $settings['unit'] ); ?></span> |
| 31 |
<?php endif; ?> |
| 32 |
</div> |
| 33 |
|