ajmeireles Posted August 25, 2018 Share Posted August 25, 2018 Hello everyone. I've a simple question about hooks. Can I call the same hook function at differents php files? For example: hooka.php -> using DailyCronJob hook function hookb.php -> using the SAME DailyCronJob hook function, but to other proccess/operation. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 26, 2018 Share Posted August 26, 2018 19 hours ago, ajmeireles said: Can I call the same hook function at differents php files? For example: hooka.php -> using DailyCronJob hook function hookb.php -> using the SAME DailyCronJob hook function, but to other proccess/operation. yes.... but take notice of Priority values of each hook as they will define the order in which they're run (and that order might be important depending upon what each is doing). https://developers.whmcs.com/hooks/priority/ 0 Quote Link to comment Share on other sites More sharing options...
bear Posted August 26, 2018 Share Posted August 26, 2018 Quote The priority can be any valid integer value. The docs don't really explain much, as usual. Assuming that's the number in the first line of the hook, is 1 higher (as in more important) than 2 or the other way 'round? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 26, 2018 Share Posted August 26, 2018 2 minutes ago, bear said: The docs don't really explain much, as usual. Assuming that's the number in the first line of the hook, is 1 higher (as in more important) than 2 or the other way 'round? 1 is highest.. I tend to use 1 by default when posting hooks here as i've no idea which other hooks could be running on the users site... in most circumstances, the priority value shouldn't matter - it's only when you need to ensure one runs after/before another that it would be relevant. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.