ReduxFramework_date

Main ReduxFramework_date class.

Defined (1)

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

/library/admin/redux-framework/inc/fields/date/field_date.php  
  1. class ReduxFramework_date { 
  2.  
  3. /** 
  4. * Field Constructor. 
  5. * Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function 
  6. * @since 1.0.0 
  7. * @access public 
  8. * @return void 
  9. */ 
  10. function __construct( $field = array(), $value = '', $parent ) { 
  11. $this->parent = $parent; 
  12. $this->field = $field; 
  13. $this->value = $value; 
  14.  
  15. /** 
  16. * Field Render Function. 
  17. * Takes the vars and outputs the HTML for the field in the settings 
  18. * @since 1.0.0 
  19. * @access public 
  20. * @return void 
  21. */ 
  22. public function render() { 
  23. $placeholder = ( isset( $this->field['placeholder'] ) ) ? ' placeholder="' . esc_attr( $this->field['placeholder'] ) . '" ' : ''; 
  24.  
  25. echo '<input data-id="' . $this->field['id'] . '" type="text" id="' . $this->field['id'] . '-date" name="' . $this->field['name'] . $this->field['name_suffix'] . '"' . $placeholder . 'value="' . $this->value . '" class="redux-datepicker regular-text ' . $this->field['class'] . '" />'; 
  26.  
  27. /** 
  28. * Enqueue Function. 
  29. * If this field requires any scripts, or css define this function and register/enqueue the scripts/css 
  30. * @since 1.0.0 
  31. * @access public 
  32. * @return void 
  33. */ 
  34. public function enqueue() { 
  35.  
  36. if ($this->parent->args['dev_mode']) { 
  37. wp_enqueue_style( 
  38. 'redux-field-date-css',  
  39. ReduxFramework::$_url . 'inc/fields/date/field_date.css',  
  40. array(),  
  41. time(),  
  42. 'all' 
  43. ); 
  44.  
  45. wp_enqueue_script( 
  46. 'redux-field-date-js',  
  47. ReduxFramework::$_url . 'inc/fields/date/field_date' . Redux_Functions::isMin() . '.js',  
  48. array( 'jquery', 'jquery-ui-core', 'jquery-ui-datepicker', 'redux-js' ),  
  49. time(),  
  50. true 
  51. );