api/hooks

Hooks allow inserting filters at certain points in a pageload. There are two types of hooks, pre and post, which are called before or after the event they are assigned to. "pre" hooks are called with no arguments and return true. If one returns false, the rest of the hooks are called, but the event is cancelled. "post" hooks are called with the result of the event and return the data, which may have been modified by the hook.

 

function hook_add_dummy_text( $data ) { cwlog('Dummy called with '.$data->id); if($data->revision['current']['mimetype']=='wiki/clickwiki') $data->revision['current']['wiki/clickwiki']= "This is a paragraph that was inserted by a [http://clickwiki.org/api/hooks hook].\n\n". $data->revision['current']['wiki/clickwiki']; return $data; } $cwiki['hook']['get']['post'][]=array('call'=>'hook_add_dummy_text');

 

 
Top
"api/hooks". ClickWiki. 23 Apr 2007 17:53 UTC
Revision: http://clickwiki.cheshirehall.org/api/hook/1177350813/
Current Revision: http://clickwiki.cheshirehall.org/api/hook/
When citing wiki pages you must include the revision.