function fasttoggle_comment_load_comment in Fasttoggle 7
Enable modules to add properties to comments through hook_comment().
To support toggling, a property needs to be loaded onto the base object. hook_nodeapi() and hook_user() support a 'load' op but _comment_load() loads data only from the comments table. This function allows modules to load properties onto comments through a 'load' op in hook_comment() and hence to produce custom comment properties that support toggling.
File
- module/
fasttoggle_comment/ fasttoggle_comment.module, line 43
Code
function fasttoggle_comment_load_comment(&$comment) {
if ($extra = comment_invoke_comment($comment, 'load')) {
foreach ($extra as $key => $value) {
$comment->{$key} = $value;
}
}
}