acf_field_time_picker::render_field() public ACF 3.6
Create the HTML interface for your field
{} Это метод класса: acf_field_time_picker{}
Хуков нет.
Возвращает
Null. Ничего.
Использование
$acf_field_time_picker = new acf_field_time_picker(); $acf_field_time_picker->render_field( $field );
-
- ($field) (обязательный)
- an array holding all the field's data
Список изменений
С версии 3.6 | Введена. |
Код acf_field_time_picker::render_field() acf field time picker::render field ACF 5.9.1
function render_field( $field ) {
// format value
$display_value = '';
if( $field['value'] ) {
$display_value = acf_format_date( $field['value'], $field['display_format'] );
}
// vars
$div = array(
'class' => 'acf-time-picker acf-input-wrap',
'data-time_format' => acf_convert_time_to_js($field['display_format'])
);
$hidden_input = array(
'id' => $field['id'],
'class' => 'input-alt',
'type' => 'hidden',
'name' => $field['name'],
'value' => $field['value'],
);
$text_input = array(
'class' => 'input',
'type' => 'text',
'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
}