That is a draft for the documentation on spip.net :
Can you give me some feedback ?
During the normal execution of several commands, call-outs are made to
optional scripts that allow a developer to add functionality or
checking. Typically, the hooks allow for a command to change the
values of function arguments before any other call, and allow for a
post-processing treatment that will always change the function result.
Exemple :
function prefix_treatment($flow) {
/* add something to the flow */
$flow .= 'This is some html code';
return $flow;
}
plugin.xml defines the implemented hooks with a list of <pipeline> markups:
<pipeline>
<nom>point_entree</nom>
<action>fonction</action>
<inclure>fichier.php</inclure>
</pipeline>
Composition : 3 markups
<nom> : name of the hook (from a list defined in ecrire/inc_version.php)
<action> : function name without it's prefix
<inclure> : file name that defines the previous function. It's name
must be prefix_action
More details : http://doc.spip.org/@Tuto-Se-servir-des-points-d-entree
(this is a simplified translation of the first part. The other ones are :
- an more advanced exemple
- a list (incomplete) of the existing hooks
.Gilles