hook_comment_presave
- Versions
- 7
hook_comment_presave($comment)
The comment passed validation and is about to be saved.
Modules may make changes to the comment before it is saved to the database.
Parameters
$comment The comment object.
Related topics
Code
modules/comment/comment.api.php, line 21
<?php
function hook_comment_presave($comment) {
// Remove leading & trailing spaces from the comment subject.
$comment->subject = trim($comment->subject);
}
?>Login or register to post comments 