1 comment.api.php hook_comment_insert($comment)

Respond to creation of a new comment.

Parameters

$comment: The comment object.

Related topics

File

core/modules/comment/comment.api.php, line 32
Hooks provided by the Comment module.

Code

function hook_comment_insert($comment) {
  // Reindex the node when comments are added.
  search_touch_node($comment->nid);
}