{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Hooks","description":"Developer documentation for the WHMCS API — the","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"hooks","__idx":0},"children":["Hooks"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Hooks that the module should define within WHMCS are defined in a file named “hooks.php”."," ","This should be within your custom module folder."," ","That will then become detected and any hooks that exist will be loaded on every page of WHMCS."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The hook functions within that file should be defined in exactly the same way as normal."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Please refer to ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://developers.whmcs.com/hooks/","title":"Hooks"},"children":["Hook Documentation"]}," for more info on creating and working with hooks in WHMCS."]}]},"headings":[{"value":"Hooks","id":"hooks","depth":1}],"frontmatter":{"title":"Hooks","seo":{"title":"Hooks"}},"lastModified":"2026-08-03T17:00:42.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/addon-modules/hooks","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}