comment_invoke_comment

  1. drupal
    1. 4.7
    2. 5 comment.module
    3. 6 comment.module
Versions
4.7 – 6 comment_invoke_comment(&$comment, $op)

Invoke a hook_comment() operation in all modules.

Parameters

&$comment A comment object.

$op A string containing the name of the comment operation.

Return value

The returned value of the invoked hooks.

▾ 6 functions call comment_invoke_comment()

comment_admin_overview_submit in modules/comment.module
Execute the chosen 'Update option' on the selected comments, such as publishing, unpublishing or deleting.
comment_form in modules/comment.module
comment_save in modules/comment.module
Accepts a submission of new or changed comment content.
comment_validate in modules/comment.module
theme_comment_view in modules/comment.module
_comment_delete_thread in modules/comment.module

Code

modules/comment.module, line 1759

<?php
function comment_invoke_comment(&$comment, $op) {
  $return = array();
  foreach (module_implements('comment') as $name) {
    $function = $name . '_comment';
    $result = $function($comment, $op);
    if (isset($result) && is_array($result)) {
      $return = array_merge($return, $result);
    }
    else if (isset($result)) {
      $return[] = $result;
    }
  }
  return $return;
}
?>