wordpress/wp-content/themes/basic/themify/themify-metabox/includes/themify-field-types.php
/**
 * Generates date picker field for Themify Custom Panel.
 *
 * @param array $args Field settings.
 *
 * @since 1.7.1
 * @return string
 */
Generates date picker field for Themify Custom Panel.
@param array $args Field settings.


Generates date picker field for Themify Custom Panel . @param array $args Field settings .
function themify_meta_field_date( $args ) {
	$meta_box = $args['meta_box'];
	$meta_value = $args['meta_value'];
	extract($args, EXTR_OVERWRITE);
	if ( isset( $meta_box['meta']['default'] ) && $meta_box['meta']['default'] != '' ) {
		$default = $meta_box['meta']['default'];
	} else {
		$default = '';
	}
	$required = ( isset( $meta_box['meta']['required'] ) && true == $meta_box['meta']['required'] ) ? 'required' : '';
	$pick  = isset( $meta_box['meta']['pick'] ) && '' != $meta_box['meta']['pick'] ? $meta_box['meta']['pick']  : __( 'Pick Date', 'themify' );
	$close = isset( $meta_box['meta']['close'] ) && '' != $meta_box['meta']['close'] ? $meta_box['meta']['close'] : __( 'Done', 'themify' );
	$clear = isset( $meta_box['meta']['clear'] ) && '' != $meta_box['meta']['clear'] ? $meta_box['meta']['clear'] : __( 'Clear', 'themify' );
	$date_format = isset( $meta_box['meta']['date_format'] ) && '' != $meta_box['meta']['date_format'] ? $meta_box['meta']['date_format'] : 'yy-mm-dd';
	$time_format = isset( $meta_box['meta']['time_format'] ) && '' != $meta_box['meta']['time_format'] ? $meta_box['meta']['time_format'] : 'hh:mm tt';
	$timeseparator = isset( $meta_box['meta']['timeseparator'] ) && '' != $meta_box['meta']['timeseparator'] ? $meta_box['meta']['timeseparator'] : ' @ ';
	$html = sprintf( '
		<div class="disableDateField"></div>
		<input %s type="text" id="%s" name="%s" value="%s" data-clear="%s" data-label="%s"
		 data-close="%s"
		 data-dateformat="%s" data-timeformat="%s" data-timeseparator="%s" class="themify_input_field medium themifyDatePicker" data-first-day="%s" />
		<input type="button" id="%s" data-picker="%s" value="%s" class="button themifyClearDate themifyOpacityTransition %s" >',
	$required, esc_attr( $meta_box['name'] ), esc_attr( $meta_box['name'] ), esc_attr( $meta_value? $meta_value : $default ), 'clear-'.esc_attr( $meta_box['name'] ), esc_attr( $pick ), esc_attr( $close ), esc_attr( $date_format ), esc_attr( $time_format ), esc_attr( $timeseparator ), get_option( 'start_of_week', '0' ),
	'clear-'.esc_attr( $meta_box['name'] ), esc_attr( $meta_box['name'] ), esc_attr( $clear ), $meta_value? 'themifyFadeIn' : '' );
	if(isset($meta_box['label']) && '' != $meta_box['label'])
		$html = sprintf('<label for="%s">%s %s</label>', esc_attr( $meta_box['name'] ), $html, esc_attr( $meta_box['label'] ));
	$html .= isset( $meta_box['description'] )? themify_meta_field_get_description($meta_box['description']) : '';
	if ( isset( $meta_box['before'] ) ) $html = $meta_box['before'] . $html;
	if ( isset( $meta_box['after'] ) ) $html .= $meta_box['after'];
	echo $html;
}
function themify_meta_field_date ( $ args ) { $ meta_box = $ args [ 'meta_box' ] ; $ meta_value = $ args [ 'meta_value' ] ; extract ( $ args , EXTR_OVERWRITE ) ; if ( isset ( $ meta_box [ 'meta' ] [ 'default' ] ) && $ meta_box [ 'meta' ] [ 'default' ] != '' ) { $ default = $ meta_box [ 'meta' ] [ 'default' ] ; } else { $ default = '' ; } $ required = ( isset ( $ meta_box [ 'meta' ] [ 'required' ] ) && true == $ meta_box [ 'meta' ] [ 'required' ] ) ? 'required' : '' ; $ pick = isset ( $ meta_box [ 'meta' ] [ 'pick' ] ) && '' != $ meta_box [ 'meta' ] [ 'pick' ] ? $ meta_box [ 'meta' ] [ 'pick' ] : __ ( 'Pick Date' , 'themify' ) ; $ close = isset ( $ meta_box [ 'meta' ] [ 'close' ] ) && '' != $ meta_box [ 'meta' ] [ 'close' ] ? $ meta_box [ 'meta' ] [ 'close' ] : __ ( 'Done' , 'themify' ) ; $ clear = isset ( $ meta_box [ 'meta' ] [ 'clear' ] ) && '' != $ meta_box [ 'meta' ] [ 'clear' ] ? $ meta_box [ 'meta' ] [ 'clear' ] : __ ( 'Clear' , 'themify' ) ; $ date_format = isset ( $ meta_box [ 'meta' ] [ 'date_format' ] ) && '' != $ meta_box [ 'meta' ] [ 'date_format' ] ? $ meta_box [ 'meta' ] [ 'date_format' ] : 'yy-mm-dd' ; $ time_format = isset ( $ meta_box [ 'meta' ] [ 'time_format' ] ) && '' != $ meta_box [ 'meta' ] [ 'time_format' ] ? $ meta_box [ 'meta' ] [ 'time_format' ] : 'hh:mm tt' ; $ timeseparator = isset ( $ meta_box [ 'meta' ] [ 'timeseparator' ] ) && '' != $ meta_box [ 'meta' ] [ 'timeseparator' ] ? $ meta_box [ 'meta' ] [ 'timeseparator' ] : ' @ ' ; $ html = sprintf ( '
		<div class="disableDateField"></div>
		<input %s type="text" id="%s" name="%s" value="%s" data-clear="%s" data-label="%s"
		 data-close="%s"
		 data-dateformat="%s" data-timeformat="%s" data-timeseparator="%s" class="themify_input_field medium themifyDatePicker" data-first-day="%s" />
		<input type="button" id="%s" data-picker="%s" value="%s" class="button themifyClearDate themifyOpacityTransition %s" >' , $ required , esc_attr ( $ meta_box [ 'name' ] ) , esc_attr ( $ meta_box [ 'name' ] ) , esc_attr ( $ meta_value ? $ meta_value : $ default ) , 'clear-' . esc_attr ( $ meta_box [ 'name' ] ) , esc_attr ( $ pick ) , esc_attr ( $ close ) , esc_attr ( $ date_format ) , esc_attr ( $ time_format ) , esc_attr ( $ timeseparator ) , get_option ( 'start_of_week' , '0' ) , 'clear-' . esc_attr ( $ meta_box [ 'name' ] ) , esc_attr ( $ meta_box [ 'name' ] ) , esc_attr ( $ clear ) , $ meta_value ? 'themifyFadeIn' : '' ) ; if ( isset ( $ meta_box [ 'label' ] ) && '' != $ meta_box [ 'label' ] ) $ html = sprintf ( '<label for="%s">%s %s</label>' , esc_attr ( $ meta_box [ 'name' ] ) , $ html , esc_attr ( $ meta_box [ 'label' ] ) ) ; $ html .= isset ( $ meta_box [ 'description' ] ) ? themify_meta_field_get_description ( $ meta_box [ 'description' ] ) : '' ; if ( isset ( $ meta_box [ 'before' ] ) ) $ html = $ meta_box [ 'before' ] . $ html ; if ( isset ( $ meta_box [ 'after' ] ) ) $ html .= $ meta_box [ 'after' ] ; echo $ html ; }
Generates date picker field for Themify Custom Panel.
Generates date picker field for Themify Custom Panel .