Dear WHMCS Development Team,
I am writing to propose an enhancement to the current WHMCS system that would greatly benefit developers and users aiming for higher customization levels in theme development. Presently, as per the WHMCS documentation, all custom hooks are required to be located in the
/includes/hooks/
directory of the WHMCS installation, and module-specific hooks are located within a
hooks.php
file inside module directories. Reference: [Getting Started with Hooks](
https://developers.whmcs.com/hooks/getting-started/) and [Module Hooks](
https://developers.whmcs.com/hooks/module-hooks/).
This structure works well for global and module-specific customizations. However, it limits theme-specific enhancements because there is no current provision for theme-specific hooks within the
/templates/your-template/includes/hooks
directory. The theme includes directory is generally reserved for template files shared across multiple pages as outlined in the [Include Files](
https://developers.whmcs.com/themes/customising/) documentation. This arrangement separates it distinctly from the
/includes/hooks
directory.
Implementing a directory for theme-specific hooks would offer several benefits:
1. **Enhanced Customization**: Developers could tailor functionality specific to themes without risking interference with the core or other themes.
2. **Easier Theme Updates**: Theme updates and maintenance would be streamlined, as the hooks specific to a theme would be encapsulated within its directory.
3. **Improved Organization**: It would improve code organization by keeping theme-related customizations within the theme’s own directory structure.
Given these potential advantages, I suggest considering the integration of theme-specific hook directories into WHMCS's core functionality. A structured approach could be to allow for a hooks directory within each theme, similar to
/templates/your-template/includes/hooks
, where developers can place their custom hook files.
I encourage the team to review this suggestion and consider its feasibility for future updates. For wider community input and to gauge interest, I have also submitted this proposal to the WHMCS feature requests tracker. I believe that this feature could significantly enhance the flexibility and usability of WHMCS for developers focused on creating customized user experiences.
Thank you for considering this enhancement. I look forward to your thoughts and the possibility of seeing this implementation in a future version of WHMCS.
Best regards,
Post the first comment
Login to post a comment.