<?php
/***********************
/*
/* WM4_Customize_Slider_Control
/*
/***********************/
class WM4_Customize_Slider_Control extends WP_Customize_Control
{
// Setup control type
public $type = 'slider';
// Override content render function to output slider HTML
public function render_content()
{ ?>
<div class="wm4">
<label>
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
</label>
<input name="<?php echo $this->id; ?>" type="text" <?php $this->link(); ?> value="<?php echo $this->value(); ?>" />
<div class="slider"></div>
</div>
<?php
}
// Function to enqueue the right jquery scripts and styles
public function enqueue() {
wp_enqueue_script( 'jquery-ui-core' );
wp_enqueue_script( 'jquery-ui-slider' );
wp_register_script( 'wm4-customcontrol-slider-js', WM4DIR . '/admin/js/customcontrol.slider.js' );
wp_enqueue_script( 'wm4-customcontrol-slider-js' );
wp_register_style('wm4jqueryui', WM4DIR . '/admin/css/jquery-ui-1.10.1.custom.css');
wp_enqueue_style('wm4jqueryui');
}
}
?>