hook_comment_presave
function hook_comment_presave
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
File
- modules/comment/comment.api.php, line 21
- Hooks provided by the Comment module.
Code
function hook_comment_presave($comment) { // Remove leading & trailing spaces from the comment subject. $comment->subject = trim($comment->subject); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!comment!comment.api.php/function/hook_comment_presave/7.x