acf_field__accordion::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__accordion{}
Хуков нет.
Возвращает
Null. Ничего.
Использование
$acf_field__accordion = new acf_field__accordion(); $acf_field__accordion->render_field_settings( $field );
- an($field -) (обязательный)
- array holding all the field's data
Список изменений
С версии 3.6 | Введена. |
Код acf_field__accordion::render_field_settings() acf field accordion::render field settings ACF 5.9.1
function render_field_settings( $field ) {
/*
// message
$message = '';
$message .= '<p>' . __( 'Accordions help you organize fields into panels that open and close.', 'acf') . '</p>';
$message .= '<p>' . __( 'All fields following this accordion (or until another accordion is defined) will be grouped together.','acf') . '</p>';
// default_value
acf_render_field_setting( $field, array(
'label' => __('Instructions','acf'),
'instructions' => '',
'name' => 'notes',
'type' => 'message',
'message' => $message,
));
*/
// active
acf_render_field_setting( $field, array(
'label' => __('Open','acf'),
'instructions' => __('Display this accordion as open on page load.','acf'),
'name' => 'open',
'type' => 'true_false',
'ui' => 1,
));
// multi_expand
acf_render_field_setting( $field, array(
'label' => __('Multi-expand','acf'),
'instructions' => __('Allow this accordion to open without closing others.','acf'),
'name' => 'multi_expand',
'type' => 'true_false',
'ui' => 1,
));
// endpoint
acf_render_field_setting( $field, array(
'label' => __('Endpoint','acf'),
'instructions' => __('Define an endpoint for the previous accordion to stop. This accordion will not be visible.','acf'),
'name' => 'endpoint',
'type' => 'true_false',
'ui' => 1,
));
}