acf_field_time_picker::render_field_settings
Create extra options for your field. This is rendered when editing a field. The value of $field['name'] can be used (like bellow) to save extra data to the $field
Метод класса: acf_field_time_picker{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$acf_field_time_picker = new acf_field_time_picker(); $acf_field_time_picker->render_field_settings( $field );
- $field(обязательный)
- .
Список изменений
| С версии 3.6 | Введена. |
Код acf_field_time_picker::render_field_settings() acf field time picker::render field settings ACF 6.4.2
function render_field_settings( $field ) {
$g_i_a = date_i18n( 'g:i a' );
$H_i_s = date_i18n( 'H:i:s' );
echo '<div class="acf-field-settings-split">';
acf_render_field_setting(
$field,
array(
'label' => __( 'Display Format', 'acf' ),
'hint' => __( 'The format displayed when editing a post', 'acf' ),
'type' => 'radio',
'name' => 'display_format',
'other_choice' => 1,
'choices' => array(
'g:i a' => '<span>' . $g_i_a . '</span><code>g:i a</code>',
'H:i:s' => '<span>' . $H_i_s . '</span><code>H:i:s</code>',
'other' => '<span>' . __( 'Custom:', 'acf' ) . '</span>',
),
)
);
acf_render_field_setting(
$field,
array(
'label' => __( 'Return Format', 'acf' ),
'hint' => __( 'The format returned via template functions', 'acf' ),
'type' => 'radio',
'name' => 'return_format',
'other_choice' => 1,
'choices' => array(
'g:i a' => '<span>' . $g_i_a . '</span><code>g:i a</code>',
'H:i:s' => '<span>' . $H_i_s . '</span><code>H:i:s</code>',
'other' => '<span>' . __( 'Custom:', 'acf' ) . '</span>',
),
)
);
echo '</div>';
}