EULA Lifecycle Actions #
Version note: EULA lifecycle action hooks were introduced in v2.0.0 as part of the EULA and Terms system.
These WordPress action hooks fire when EULA documents are created, updated, or deleted. Use them to integrate your extensions with the EULA system.
dmsilm_eula_created #
Fires after a new EULA document is created and saved.
do_action( 'dmsilm_eula_created', int $eula_id, array $eula_data );| Parameter | Type | Description |
|---|---|---|
| $eula_id | int | The ID of the newly created EULA document |
| $eula_data | array | The EULA document data (title, slug, content, status) |
Use cases: Sync EULA to external legal management system, log creation for audit trail, notify legal team.
dmsilm_eula_updated #
Fires after an existing EULA document is updated. This includes content changes (which create a new version), status changes, and metadata updates.
do_action( 'dmsilm_eula_updated', int $eula_id, array $eula_data, array $old_data );| Parameter | Type | Description |
|---|---|---|
| $eula_id | int | The ID of the updated EULA document |
| $eula_data | array | The new EULA document data |
| $old_data | array | The previous EULA document data before the update |
Use cases: Detect content changes and trigger re-review workflow, sync updates to external system, track version history externally.
dmsilm_eula_deleted #
Fires after an EULA document is deleted. Only draft EULAs with no acceptance records can be deleted.
do_action( 'dmsilm_eula_deleted', int $eula_id, array $eula_data );| Parameter | Type | Description |
|---|---|---|
| $eula_id | int | The ID of the deleted EULA document |
| $eula_data | array | The EULA document data at time of deletion |
Use cases: Clean up external references, remove from sync targets.
Example: Logging EULA Changes #
add_action( 'dmsilm_eula_created', function( $eula_id, $eula_data ) {
error_log( sprintf( 'EULA #%d created: %s', $eula_id, $eula_data['title'] ) );
}, 10, 2 );
add_action( 'dmsilm_eula_updated', function( $eula_id, $eula_data, $old_data ) {
if ( $eula_data['content'] !== $old_data['content'] ) {
error_log( sprintf( 'EULA #%d content changed — new version created', $eula_id ) );
}
}, 10, 3 );Note on EULA Acceptance #
EULA acceptance is logged internally by the order processing system. There is no public action hook for acceptance events in v2.0.0. If you need to react to acceptance, query the acceptance log table directly.
