function comment_entity_extra_field_info

Same name in other branches
  1. 9 core/modules/comment/comment.module \comment_entity_extra_field_info()
  2. 8.9.x core/modules/comment/comment.module \comment_entity_extra_field_info()
  3. 11.x core/modules/comment/comment.module \comment_entity_extra_field_info()

Implements hook_entity_extra_field_info().

File

core/modules/comment/comment.module, line 87

Code

function comment_entity_extra_field_info() {
    $return = [];
    foreach (CommentType::loadMultiple() as $comment_type) {
        $return['comment'][$comment_type->id()] = [
            'form' => [
                'author' => [
                    'label' => t('Author'),
                    'description' => t('Author textfield'),
                    'weight' => -2,
                ],
            ],
        ];
        $return['comment'][$comment_type->id()]['display']['links'] = [
            'label' => t('Links'),
            'description' => t('Comment operation links'),
            'weight' => 100,
            'visible' => TRUE,
        ];
    }
    return $return;
}

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