function hook_conditional_fields in Conditional Fields 8
Same name and namespace in other branches
- 4.x conditional_fields.api.php \hook_conditional_fields()
Build a list of available fields.
Fields that use the Field API should be available to Conditional Fields automatically. This hook provides a mechanism to register pseudo-fields (such as those provided by Field Group.)
Parameters
string $entity_type: Name of the entity type being configured.
string $bundle_name: Name of the entity bundle being configured.
Return value
array Fields provided by this module. Keyed by machine name, with field labels as values.
See also
ConditionalFieldForm::getFields().
hook_conditional_fields_alter().
conditional_fields_conditional_fields().
1 function implements hook_conditional_fields()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
File
- ./
conditional_fields.api.php, line 32 - Hooks for the conditional_fields module.
Code
function hook_conditional_fields($entity_type, $bundle_name) {
$fields = [];
$groups = field_group_info_groups($entity_type, $bundle_name, 'form', 'default');
foreach ($groups as $name => $group) {
$fields[$name] = $group->label;
}
return $fields;
}