{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"type":"markdown"},"seo":{"title":"Module 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":"module-hooks","__idx":0},"children":["Module Hooks"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Module hooks follow all the same principles as regular hooks."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"defining-hooks-within-a-module","__idx":1},"children":["Defining Hooks within a Module"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To provide hooks as part of a module, create a file named ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["hooks.php"]}," in the root of your module directory."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This hooks file will be detected and loaded by WHMCS on every page load."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Note"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Please note that hook files are detected at the time a provisioning, registrar, or addon module is activated. If a hook file is added after the module has already been activated, some additional steps may need to be performed for WHMCS to recognize it. For provisioning modules, this can be accomplished by accessing the Module Settings tab of an applicable product under ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Setup"]}," > ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Products/Services"]}," > ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Products/Services"]}," and clicking ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Save Changes"]},". For a registrar module, re-saving the settings for it under ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Setup"]}," > ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Products/Services"]}," > ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Domain Registrars"]}," would be sufficient. Finally, for addon modules, re-saving the settings under Setup > Addon Modules will address this."]}]}]},"headings":[{"value":"Module Hooks","id":"module-hooks","depth":1},{"value":"Defining Hooks within a Module","id":"defining-hooks-within-a-module","depth":2}],"frontmatter":{"title":"Module Hooks","seo":{"title":"Module Hooks"}},"lastModified":"2026-08-04T14:47:26.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/hooks/module-hooks","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}