OnDocFormDelete
Last updated Oct 14th, 2026 | Page history | Improve this page | Report an issue
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn moreEvent: OnDocFormDelete¶
Fires after a Resource is deleted in the Manager, from the Resource\Delete processor.
- Service: 1 - Parser Service Events
- Group: Resources
Event Parameters¶
| Name | Description |
|---|---|
| id | The ID of the Resource. |
| children | IDs of the child Resources deleted with it. |
| resource | A reference to the modResource object. |
Example¶
This plugin logs the deleted Resource together with its children:
<?php
$eventName = $modx->event->name;
switch($eventName) {
case 'OnDocFormDelete':
$modx->log(modX::LOG_LEVEL_ERROR, 'Resource '.$id.' was deleted');
foreach ($children as $childId) {
$child = $modx->getObject('modResource', $childId);
if ($child) {
$modx->log(modX::LOG_LEVEL_ERROR, 'Child deleted: '.$child->get('pagetitle'));
}
}
break;
}
See Also¶
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn more










