Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. CommentHooks.php

function CommentHooks::entityExtraFieldInfo

Implements hook_entity_extra_field_info().

File

core/modules/comment/src/Hook/CommentHooks.php, line 73

Class

CommentHooks
Hook implementations for comment.

Namespace

Drupal\comment\Hook

Code

public function entityExtraFieldInfo() {
    $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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal