When a module has a hooks.php file included with it, the functions within have the $vars parameter, much like the module functions themselves.
However unlike module functions, the $vars parameter that's passed for hooks does not include useful variables from the module, like module fields, and any custom language strings found in the module's lang/.php file.
Because this hooks file is directly part of the module, it is frequently useful to have that data readily available in its hooks.
This request is to have WHMCS merge the hook $vars with at least some of the $vars that the module functions receive, such as:
- Module fields (settings)
- Module name
- Module version
- The language of the logged in user (whether client or admin)
- _lang so that we can access module language strings within hooks
Post the first comment
Login to post a comment.