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.


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

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

## See Also

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

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.


  • modmore
  • Jens Wittmann – Gestaltung & Entwicklung
  • Fabian Christen
  • Digital Penguin
  • Dannevang Digital
  • Sepia River Studios
  • Chris Fickling
  • CrewMark
  • deJaya
  • Following Sea
  • Anton Tarasov
  • eydolan
  • Raffy
  • Lefthandmedia
  • Murray Wood
  • Snow Creative
  • Nick Clark
  • Helen
  • JT Skaggs
  • krisznet
  • YJ
  • Yanni
  • Richard


$370 per month—let's make that $500!

Learn more