ReduxFramework_date

Main ReduxFramework_date class.

Defined (1)

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

/inc/ReduxFramework/ReduxCore/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 ' . $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. // wp_enqueue_style( 
  36. // 'redux-field-date-css',  
  37. // ReduxFramework::$_url . 'inc/fields/date/field_date.css',  
  38. // time(),  
  39. // true 
  40. // ); 
  41.  
  42. redux_enqueue_style( 
  43. $this->parent,  
  44. 'redux-field-date-css',  
  45. ReduxFramework::$_url . 'inc/fields/date/field_date.css',  
  46. ReduxFramework::$_dir . 'inc/fields/date',  
  47. array(),  
  48. time(),  
  49. false 
  50. );  
  51.  
  52. wp_enqueue_script( 
  53. 'redux-field-date-js',  
  54. ReduxFramework::$_url . 'inc/fields/date/field_date' . Redux_Functions::isMin() . '.js',  
  55. array( 'jquery', 'jquery-ui-core', 'jquery-ui-datepicker', 'redux-js' ),  
  56. time(),  
  57. true 
  58. );