function forum_entity_bundle_field_info_alter

Same name and namespace in other branches
  1. 9 core/modules/forum/forum.module \forum_entity_bundle_field_info_alter()
  2. 8.9.x core/modules/forum/forum.module \forum_entity_bundle_field_info_alter()
  3. 10 core/modules/forum/forum.module \forum_entity_bundle_field_info_alter()

Implements hook_entity_bundle_field_info_alter().

File

core/modules/forum/forum.module, line 154

Code

function forum_entity_bundle_field_info_alter(&$fields, EntityTypeInterface $entity_type, $bundle) {
    if ($entity_type->id() == 'node' && !empty($fields['taxonomy_forums'])) {
        $fields['taxonomy_forums']->addConstraint('ForumLeaf', []);
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.