acf_field_time_picker::render_field_settings() public ACF 3.6
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. Ничего.
Использование
$acf_field_time_picker = new acf_field_time_picker(); $acf_field_time_picker->render_field_settings( $field );
- an($field -) (обязательный)
- array holding all the field's data
Список изменений
С версии 3.6 | Введена. |
Код acf_field_time_picker::render_field_settings() acf field time picker::render field settings ACF 5.9.1
function render_field_settings( $field ) {
// vars
$g_i_a = date_i18n('g:i a');
$H_i_s = date_i18n('H:i:s');
// display_format
acf_render_field_setting( $field, array(
'label' => __('Display Format','acf'),
'instructions' => __('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>'
)
));
// return_format
acf_render_field_setting( $field, array(
'label' => __('Return Format','acf'),
'instructions' => __('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>'
)
));
}