1. <?php
  2. /***********************
  3. /*
  4. /*  WM4_Customize_Slider_Control
  5. /*
  6. /***********************/
  7. class WM4_Customize_Slider_Control extends WP_Customize_Control
  8. {
  9.     // Setup control type
  10.     public $type = 'slider';
  11.  
  12.     // Override content render function to output slider HTML
  13.     public function render_content()
  14.     { ?>
  15.        <div class="wm4">      
  16.         <label>
  17.             <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
  18.         </label>
  19.         <input name="<?php echo $this->id; ?>" type="text" <?php $this->link(); ?> value="<?php echo $this->value(); ?>" />
  20.         <div class="slider"></div>
  21.        </div>
  22.     <?php
  23.     }
  24.    
  25.     // Function to enqueue the right jquery scripts and styles
  26.     public function enqueue() {
  27.        
  28.         wp_enqueue_script( 'jquery-ui-core' );
  29.         wp_enqueue_script( 'jquery-ui-slider' );
  30.        
  31.         wp_register_script( 'wm4-customcontrol-slider-js', WM4DIR . '/admin/js/customcontrol.slider.js' );
  32.         wp_enqueue_script( 'wm4-customcontrol-slider-js' );
  33.        
  34.         wp_register_style('wm4jqueryui', WM4DIR . '/admin/css/jquery-ui-1.10.1.custom.css');
  35.         wp_enqueue_style('wm4jqueryui');
  36.        
  37.     }
  38. }
  39. ?>