function forum_entity_bundle_field_info_alter in Drupal 9
Same name and namespace in other branches
- 8 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 140 - Provides discussion forums.
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', []);
}
}