comment_theme

comment_theme() Implements hook_theme(). File core/modules/comment/comment.module, line 126 Enables users to comment on published content. Code function comment_theme() { return array( 'comment' => array( 'render element' => 'elements', ), 'field__comment' => array( 'base hook' => 'field', ), ); }

comment_schema

comment_schema() Implements hook_schema(). File core/modules/comment/comment.install, line 39 Install, update and uninstall functions for the Comment module. Code function comment_schema() { $schema['comment_entity_statistics'] = array( 'description' => 'Maintains statistics of entity and comments posts to show "new" and "updated" flags.', 'fields' => array( 'entity_id' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE,

comment_ranking

comment_ranking() Implements hook_ranking(). File core/modules/comment/comment.module, line 757 Enables users to comment on published content. Code function comment_ranking() { return \Drupal::service('comment.statistics')->getRankingInfo(); }

comment_preview

comment_preview(CommentInterface $comment, FormStateInterface $form_state) Generates a comment preview. Parameters \Drupal\comment\CommentInterface $comment: The comment entity to preview. Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. Return value array An array as expected by drupal_render(). File core/modules/comment/comment.module, line 561 Enables users to comment on published content. Code function comment_preview(CommentInterface $comment, FormStateIn

comment_preprocess_field

comment_preprocess_field(&$variables) Prepares variables for comment field templates. Default template: field--comment.html.twig. @todo Rename to template_preprocess_field__comment() once https://www.drupal.org/node/939462 is resolved. Parameters array $variables: An associative array containing: element: An associative array containing render arrays for the list of comments, and the comment form. Array keys: comments, comment_form. File core/modules/comment/comment.module, line 738 Ena

comment_preprocess_block

comment_preprocess_block(&$variables) Implements hook_preprocess_HOOK() for block templates. File core/modules/comment/comment.module, line 605 Enables users to comment on published content. Code function comment_preprocess_block(&$variables) { if ($variables['configuration']['provider'] == 'comment') { $variables['attributes']['role'] = 'navigation'; } }

comment_node_view_alter

comment_node_view_alter(array &$build, EntityInterface $node, EntityViewDisplayInterface $display) Implements hook_ENTITY_TYPE_view_alter() for node entities. File core/modules/comment/comment.module, line 237 Enables users to comment on published content. Code function comment_node_view_alter(array &$build, EntityInterface $node, EntityViewDisplayInterface $display) { if (\Drupal::moduleHandler()->moduleExists('history')) { $build['#attributes']['data-history-node-id'] = $no

comment_node_update_index

comment_node_update_index(EntityInterface $node) Implements hook_node_update_index(). File core/modules/comment/comment.module, line 425 Enables users to comment on published content. Code function comment_node_update_index(EntityInterface $node) { $index_comments = &drupal_static(__FUNCTION__); if ($index_comments === NULL) { // Do not index in the following three cases: // 1. 'Authenticated user' can search content but can't access comments. // 2. 'Anonymous user' can s

comment_node_search_result

comment_node_search_result(EntityInterface $node) Implements hook_node_search_result(). Formats a comment count string and returns it, for display with search results. File core/modules/comment/comment.module, line 489 Enables users to comment on published content. Code function comment_node_search_result(EntityInterface $node) { $comment_fields = \Drupal::service('comment.manager')->getFields('node'); $comments = 0; $open = FALSE; foreach ($comment_fields as $field_name => $inf

comment_node_links_alter

comment_node_links_alter(array &$links, NodeInterface $node, array &$context) Implements hook_node_links_alter(). File core/modules/comment/comment.module, line 198 Enables users to comment on published content. Code function comment_node_links_alter(array &$links, NodeInterface $node, array &$context) { // Comment links are only added to node entity type for backwards // compatibility. Should you require comment links for other entity types you // can do so by implement