1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
<?php
class CMB2_Type_Text_Date extends CMB2_Type_Picker_Base {
public function render( $args = array() ) {
$args = $this->parse_args( 'text_date', array(
'class' => 'cmb2-text-small cmb2-datepicker',
'value' => $this->field->get_timestamp_format(),
'desc' => $this->_desc(),
'js_dependencies' => array( 'jquery-ui-core', 'jquery-ui-datepicker' ),
) );
if ( false === strpos( $args['class'], 'timepicker' ) ) {
$this->parse_picker_options( 'date' );
}
return parent::render( $args );
}
}