Some plugins may need to be invoked to perform certain tasks from time to time. For this reason plugins may register plugin events. These Events automatically initialize the plugin and invoke the desired callback method when triggered. The parameters passed to the callback method vary depending on the event invoked.
Adding Plugin Events
To add plugin events, simply return them from your plugin's getEvents() method.
/plugins/my_plugin/my_plugin_plugin.php
<?php class MyPluginPlugin extends Plugin { ... public function getEvents() { return array( array( 'event' => "preaction", 'callback' => array("this", "run") ) // Add multiple events here ); } public function run() { // This will execute when the "preaction" event is triggered } } ?>