hook_comment_load

Versions
7
hook_comment_load($comments)

Comments are being loaded from the database.

Parameters

$comments An array of comment objects indexed by cid.

Related topics

Code

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

<?php
function hook_comment_load($comments) {
  $result = db_query('SELECT cid, foo FROM {mytable} WHERE cid IN (:cids)', array(':cids' => array_keys($comments)));
  foreach ($result as $record) {
    $comments[$record->cid]->foo = $record->foo;
  }
}
?>
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.