2014-02-11, 09:23 PM
Hello everyone. I'm currently devoloping my own plugin, and I was wondering if it's possible to make an actual distinction between two hooks which use the same function. Let me explain that. Let's say I have this:
Is there a way to tell which hooks is calling/using someFunc()? I think it would be a waste of lines making a new function to only change one single thing. I thought using some parameter in someFunc() like someFunc($hook) might work, but then realised I cannot use parameters when adding a hook...
I'd appreciate your help.
$plugins->add_hook("newreply_do_newreply_end", "someFunc");
$plugins->add_hook("newthread_do_newthread_end", "someFunc");
function someFunc()
{
//...
}
Is there a way to tell which hooks is calling/using someFunc()? I think it would be a waste of lines making a new function to only change one single thing. I thought using some parameter in someFunc() like someFunc($hook) might work, but then realised I cannot use parameters when adding a hook...
I'd appreciate your help.
