- This line was added.
- This line was removed.
- Formatting was changed.
|Standardized Hooks trigger applications when cPanel & WHM performs an action.|
Use this system to execute custom code (hook action code) to customize how cPanel & WHM functions in specific scenarios (hookable events). For example, you could use this system to make certain that a script runs each time that a user creates an account.
For a step-by-step tutorial to create and register a hook, read our Tutorial - Create a Standardized Hook documentation.
Each standardized hook is comprised of a hookable event, a hook action, and hook registration.
To create a new standardized hook, perform the following steps:
Select a hookable event. —
Excerpt Include Guide to Standardized Hooks - Hookable Events Guide to Standardized Hooks - Hookable Events nopanel true
- Write your custom hook action code.
- Register the hook. —
Excerpt Include Guide to Standardized Hooks - The manage_hooks Utility Guide to Standardized Hooks - The manage_hooks Utility nopanel true
- The system includes a hooks registry for each hookable event. This allows hooks from your application to coexist with another application's hooks that reference the same event.
cPanel & WHM provides the
/usr/local/cpanel/bin/manage_hooksCLI utility to manage standardized hooks.
The Standardized Hook System database
Standardized Hooks System data resides in the
/var/cpanel/hooks.yaml file. This database is the authoritative reference for all standardized hook data. The Standardized Hooks System also maintains a cached copy of this database in the
/var/cpanel/hooks.cache file. The cache file regenerates automatically whenever you query the Standardized Hooks System is queried internally or through a management utility.
Do not edit this file by hand. Instead, manage Standardized Hooks with the
We encourage anyone who develops for cPanel products to read the cPanel Blog and join our Plugin Developers mailing list.