RWMB_Slider_Field

The Evolved RWMB Slider Field class.

Defined (1)

The class is defined in the following location(s).

/meta-box/inc/fields/slider.php  
  1. class RWMB_Slider_Field 
  2. /** 
  3. * Enqueue scripts and styles 
  4. * @return void 
  5. */ 
  6. static function admin_enqueue_scripts() 
  7. $url = RWMB_CSS_URL . 'jqueryui'; 
  8. wp_enqueue_style( 'jquery-ui-core', "{$url}/jquery.ui.core.css", array(), '1.8.17' ); 
  9. wp_enqueue_style( 'jquery-ui-theme', "{$url}/jquery.ui.theme.css", array(), '1.8.17' ); 
  10.  
  11. $url = RWMB_JS_URL . 'jqueryui'; 
  12. wp_enqueue_script( 'jquery-ui-slider', "{$url}/jquery.ui.slider.min.js", array( 'jquery-ui-core' ), '1.8.17', true ); 
  13. wp_enqueue_script( 'rwmb-slider', RWMB_JS_URL . 'slider.js', array( 'jquery-ui-slider' ), RWMB_VER, true ); 
  14.  
  15. /** 
  16. * Get div HTML 
  17. * @param string $html 
  18. * @param mixed $meta 
  19. * @param array $field 
  20. * @return string 
  21. */ 
  22. static function html( $html, $meta, $field ) 
  23. $id = " id='{$field['id']}'"; 
  24. $name = "name='{$field['field_name']}'"; 
  25. $val = " value='{$meta}'"; 
  26. $for = " for='{$field['id']}'"; 
  27. $format = " rel='{$field['format']}'"; 
  28. $html .= " 
  29. <div class='clearfix'> 
  30. <div class='rwmb-slider'{$format}{$id}></div> 
  31. <input type='hidden'{$name}{$val} /> 
  32. </div>"; 
  33.  
  34. return $html;