Jump to main content Jump to doc navigation

Event: OnBeforeSnipFormDelete

Fires before a Snippet is deleted in the manager.

  • Service: 1 - Parser Service Events
  • Group: Snippets

Event Parameters

Name Description
snippet A reference to the modSnippet object.
id The ID of the Snippet.

Example

Such a plugin will display a message stating that you cannot delete snippets:

<?php
$eventName = $modx->event->name;
switch($eventName) {
    case 'OnBeforeSnipFormDelete':
        $modx->event->output("You cannot delete snippets!?");
        break;
}

## See Also

- [System Events](extending-modx/plugins/system-events "System Events")
- [Plugins](extending-modx/plugins "Plugins")