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

acf_field_date_picker::render_field() public ACF 3.6

Create the HTML interface for your field

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

Хуков нет.

Возвращает

Null. Ничего.

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

$acf_field_date_picker = new acf_field_date_picker();
$acf_field_date_picker->render_field( $field );
  • ($field) (обязательный)
    an array holding all the field's data

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

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

Код acf_field_date_picker::render_field() ACF 5.9.1

<?php
function render_field( $field ) {
	
	// vars
	$hidden_value = '';
	$display_value = '';
	
	// format value
	if( $field['value'] ) {
		$hidden_value = acf_format_date( $field['value'], 'Ymd' );
		$display_value = acf_format_date( $field['value'], $field['display_format'] );
	}
	
	// elements
	$div = array(
		'class'					=> 'acf-date-picker acf-input-wrap',
		'data-date_format'		=> acf_convert_date_to_js($field['display_format']),
		'data-first_day'		=> $field['first_day'],
	);
	$hidden_input = array(
		'id'					=> $field['id'],
		'name'					=> $field['name'],
		'value'					=> $hidden_value,
	);
	$text_input = array(
		'class' 				=> 'input',
		'value'					=> $display_value,
	);
	
	// special attributes
	foreach( array( 'readonly', 'disabled' ) as $k ) {
		if( !empty($field[ $k ]) ) {
			$text_input[ $k ] = $k;
		}
	}
	
	// save_format - compatibility with ACF < 5.0.0
	if( !empty($field['save_format']) ) {
		
		// add custom JS save format
		$div['data-save_format'] = $field['save_format'];
		
		// revert hidden input value to raw DB value
		$hidden_input['value'] = $field['value'];
		
		// remove formatted value (will do this via JS)
		$text_input['value'] = '';
	}
	
	// html
	?>
	<div <?php acf_esc_attr_e( $div ); ?>>
		<?php acf_hidden_input( $hidden_input ); ?>
		<?php acf_text_input( $text_input ); ?>
	</div>
	<?php
}