function hook_field_info_entity_type_ui_definitions_alter

Same name and namespace in other branches
  1. 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

2 functions implement hook_field_info_entity_type_ui_definitions_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

comment_field_info_entity_type_ui_definitions_alter in core/modules/comment/comment.module
Implements hook_field_info_entity_type_ui_definitions_alter().
field_test_field_info_entity_type_ui_definitions_alter in core/modules/field/tests/modules/field_test/field_test.module
Implements hook_field_info_entity_type_ui_definitions_alter().

File

core/modules/field/field.api.php, line 74

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.