This hook is useful if you wanted to override getComment method globally with custom paramters passed to (OssnAnnotation->searchAnnotation method.) https://github.com/opensource-socialnetwork/opensource-socialnetwork/blob/v6.x/components/OssnComments/classes/OssnComments.php#L163
One of working example is OssnBlock to strip comment for blocked users. https://github.com/opensource-socialnetwork/opensource-socialnetwork/blob/v6.x/components/OssnBlock/ossn_com.php#L49
~~~
<?php
function my_component_init(){
ossn_add_hook('comments', 'GetComments', 'my_component_hook');
}
function my_component_hook($hook, $type, $vars, $extra_params){
//contains the actual paramters that is supplied for searching comments.
//$extra_params contains type (post, entity or object).
error_log(print_r($vars, true));
return $vars;
}
ossn_register_callback('ossn', 'init', 'my_component_init');
~~~