function hook_field_info_entity_type_ui_definitions_alter
Same name in other branches
- 10 core/modules/field/field.api.php \hook_field_info_entity_type_ui_definitions_alter()
Alters the UI field definitions.
This hook can be used for altering field definitions available in the UI dynamically per entity type. For example, it can be used to hide field types that are incompatible with an entity type.
Parameters
array $ui_definitions: Definition of all field types that can be added via UI.
string $entity_type_id: The entity type id.
See also
\Drupal\Core\Field\FieldTypePluginManagerInterface::getEntityTypeUiDefinitions
Related topics
File
-
core/
modules/ field/ field.api.php, line 84
Code
function hook_field_info_entity_type_ui_definitions_alter(array &$ui_definitions, string $entity_type_id) {
if ($entity_type_id === 'node') {
unset($ui_definitions['field_type_not_compatible_with_node']);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.