WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

acf_field_date_and_time_picker::render_field() public ACF 3.6

Create the HTML interface for your field

{} Это метод класса: acf_field_date_and_time_picker{}

Хуков нет.

Возвращает

null. Ничего.

Использование

$acf_field_date_and_time_picker = new acf_field_date_and_time_picker();
$acf_field_date_and_time_picker->render_field( $field );
$field (обязательный)
-

Список изменений

С версии 3.6 Введена.

Код acf_field_date_and_time_picker::render_field() ACF 5.9.1

<?php
function render_field( $field ) {
	
	// format value
	$hidden_value = '';
	$display_value = '';
	
	if( $field['value'] ) {
		
		$hidden_value = acf_format_date( $field['value'], 'Y-m-d H:i:s' );
		$display_value = acf_format_date( $field['value'], $field['display_format'] );
		
	}
	
	
	// convert display_format to date and time
	// the letter 'm' is used for date and minute in JS, so this must be done here in PHP
	$formats = acf_split_date_time($field['display_format']);
	
	
	// vars
	$div = array(
		'class'					=> 'acf-date-time-picker acf-input-wrap',
		'data-date_format'		=> acf_convert_date_to_js($formats['date']),
		'data-time_format'		=> acf_convert_time_to_js($formats['time']),
		'data-first_day'		=> $field['first_day'],
	);
	
	$hidden_input = array(
		'id'					=> $field['id'],
		'class' 				=> 'input-alt',
		'name'					=> $field['name'],
		'value'					=> $hidden_value,
	);
	
	$text_input = array(
		'class' 				=> 'input',
		'value'					=> $display_value,
	);
	
	
	// html
	?>
	<div <?php acf_esc_attr_e( $div ); ?>>
		<?php acf_hidden_input( $hidden_input ); ?>
		<?php acf_text_input( $text_input ); ?>
	</div>
	<?php
	
}