function fasttoggle_load_comment in Fasttoggle 6
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.
1 call to fasttoggle_load_comment()
- fasttoggle_link in ./
fasttoggle.module - Implementation of hook_link().
File
- ./
fasttoggle.module, line 211 - Enables fast toggling of binary or not so binary settings.
Code
function fasttoggle_load_comment(&$comment) {
if ($extra = comment_invoke_comment($comment, 'load')) {
foreach ($extra as $key => $value) {
$comment->{$key} = $value;
}
}
}