comment_invoke_comment

Definition

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

Description

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.

Code

<?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;
}
?>
 
 

Drupal is a registered trademark of Dries Buytaert.