License Type Hooks #
New in v1.2.0
DDLS Core fires action hooks whenever a license type is created, updated, or deleted. Extensions can use these hooks to keep external systems in sync or to trigger other workflows.
Available Hooks #
| Hook | Fires When |
|---|---|
dmsilm_license_type_created | A new license type is saved for the first time |
dmsilm_license_type_updated | An existing license type is edited and saved |
dmsilm_license_type_deleted | A license type is deleted |
Parameters #
The dmsilm_license_type_created and dmsilm_license_type_updated hooks receive $type_id and $data. The dmsilm_license_type_deleted hook receives only $type_id — no $data is passed on deletion.
Created and Updated:
| Parameter | Type | Description |
|---|---|---|
$type_id | int | The database ID of the license type |
$data | array | All fields of the license type record |
Common fields in $data include: name, slug, max_activations, is_lifetime, expiry_days, and any custom fields added by extensions.
Deleted:
| Parameter | Type | Description |
|---|---|---|
$type_id | int | The database ID of the license type that was deleted |
Example: Sync on Create #
add_action( 'dmsilm_license_type_created', function( $type_id, $data ) {
My_Ext_Sync::push_license_type( $type_id, $data );
}, 10, 2 );
Example: Log on Delete #
add_action( 'dmsilm_license_type_deleted', function( $type_id ) {
My_Ext_Logger::log(
sprintf( 'License type deleted: ID %d', $type_id )
);
} );
Use Cases #
- Sync license types to an external licensing server or CRM.
- Trigger a webhook when a license type changes.
- Maintain an audit log of all license type modifications.
- Invalidate a cache that stores license type data.
Related Topics #
- [License Types](#)
- [Order Processor Integration](#)
