comment_invoke_comment

Definition

comment_invoke_comment(&$comment, $op)
drupal/modules/comment/comment.module, line 2001

Description

Invoke a hook_comment_[$op]() 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.

Code

function comment_invoke_comment(&$comment, $op) {
  $return = array();
  foreach (module_implements('comment_' . $op) as $module) {
    $function = $module . '_comment_' . $op;
    $result = $function($comment);
    if (isset($result) && is_array($result)) {
      $return = array_merge($return, $result);
    }
    elseif (isset($result)) {
      $return[] = $result;
    }
  }

  return $return;
}