hook_comment_view

Versions
7
hook_comment_view($comment)

The comment is being viewed. This hook can be used to add additional data to the comment before theming.

Parameters

$comment Passes in the comment the action is being performed on.

Return value

Nothing.

Related topics

Code

modules/comment/comment.api.php, line 69

<?php
function hook_comment_view($comment) {
  // how old is the comment
  $comment->time_ago = time() - $comment->changed;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.