acf_field_select::render_field_presentation_settings
Renders the field settings used in the "Presentation" tab.
Метод класса: acf_field_select{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$acf_field_select = new acf_field_select(); $acf_field_select->render_field_presentation_settings( $field );
- $field(массив) (обязательный)
- The field settings array.
Список изменений
| С версии 6.0 | Введена. |
Код acf_field_select::render_field_presentation_settings() acf field select::render field presentation settings ACF 6.4.2
public function render_field_presentation_settings( $field ) {
acf_render_field_setting(
$field,
array(
'label' => __( 'Stylized UI', 'acf' ),
'instructions' => __( 'Use a stylized checkbox using select2', 'acf' ),
'name' => 'ui',
'type' => 'true_false',
'ui' => 1,
)
);
acf_render_field_setting(
$field,
array(
'label' => __( 'Use AJAX to lazy load choices?', 'acf' ),
'instructions' => '',
'name' => 'ajax',
'type' => 'true_false',
'ui' => 1,
'conditions' => array(
'field' => 'ui',
'operator' => '==',
'value' => 1,
),
)
);
acf_render_field_setting(
$field,
array(
'label' => __( 'Create Options', 'acf' ),
'instructions' => __( 'Allow content editors to create new options by typing in the Select input. Multiple options can be created from a comma separated string.', 'acf' ),
'name' => 'create_options',
'type' => 'true_false',
'ui' => 1,
'conditions' => array(
array(
'field' => 'ui',
'operator' => '==',
'value' => 1,
),
array(
'field' => 'multiple',
'operator' => '==',
'value' => 1,
),
),
)
);
acf_render_field_setting(
$field,
array(
'label' => __( 'Save Options', 'acf' ),
'instructions' => __( 'Save created options back to the "Choices" setting in the field definition.', 'acf' ),
'name' => 'save_options',
'type' => 'true_false',
'ui' => 1,
'conditions' => array(
array(
'field' => 'ui',
'operator' => '==',
'value' => 1,
),
array(
'field' => 'multiple',
'operator' => '==',
'value' => 1,
),
array(
'field' => 'create_options',
'operator' => '==',
'value' => 1,
),
),
)
);
}