Adding custom code on flagging a node I am using the Flag module on my site. In which function should I add my custom code that is executed when users click on the flag button?
If you enable the Trigger and the Flag actions modules, you can assign a group of actions that is executed when a user or a node is flagged by a user.
Flag integrates also with Rules, and it allows to execute rules when a flag is used for users or nodes.