Jump to main content Jump to doc navigation

Event: OnBeforePluginFormDelete

Fires before a plugin is deleted in the manager.

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

Event Parameters

Name Description
plugin A reference to the modPlugin object.
id The ID of the Plugin.

Example

Such a plugin displays a message stating that the plugin cannot be removed:

<?php
$eventName = $modx->event->name;
switch($eventName) {
    case 'OnBeforePluginFormDelete':
        // if plugin id = 18, display a message
        if ($id == 18){
            $modx->event->output("What are you doing !? Plugin cannot be deleted ".$plugin->get('name'));
        }
        break;
}

## 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.

Backers

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

Budget

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

Learn more