Jump to content

Question about hooks and when they are called


rgf207

Recommended Posts

I've read through the hook documentation but I still have a question. If you have a hook file created and it's in your hooks directory, will that file automatically be called when you execute the action for that hook location? If not, where do you define what file should be called when an action is complete?

Link to comment
Share on other sites

WHMCS will automatically load every file in the hooks.php directory. In your hook file you create your function then tell WHMCS when to run the function with a call to the add_hook function.

 

For example, this is saying after a client is added run the create_forum_account function which is defined in the same file.

add_hook("ClientAdd",1,"create_forum_account");

Link to comment
Share on other sites

WHMCS will automatically load every file in the hooks.php directory. In your hook file you create your function then tell WHMCS when to run the function with a call to the add_hook function.

 

For example, this is saying after a client is added run the create_forum_account function which is defined in the same file.

add_hook("ClientAdd",1,"create_forum_account");

 

That's exactly what I needed to know. Thank you for your help

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated