hook_comment
Definition
hook_comment($op, $comment)
developer/hooks/core.php, line 96
Description
Act on comment modification.
This hook allows modules to take action whenever changes are made to comments.
Parameters
$op What type of action is being performed. Possible values:
- "insert"
- "moderate"
- "update"
Return value
None.
Related topics
| Name | Description |
|---|---|
| Hooks | Allow modules to interact with the Drupal core. |
Code
<?php
function hook_comment($op, $comment) {
if ($op == 'insert' || $op == 'update') {
$nid = $comment['nid'];
}
cache_clear_all_like(drupal_url(array('id' => $nid)));
}
?> 