forum_entity_bundle_field_info_alter

forum_entity_bundle_field_info_alter(&$fields, EntityTypeInterface $entity_type, $bundle)

Implements hook_entity_bundle_field_info_alter().

File

core/modules/forum/forum.module, line 139
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', []);
  }
}
doc_Drupal
2016-10-29 09:17:17
Comments
Leave a Comment

Please login to continue.