I'm creating a plugin, I want to trigger a function once the plugin is activated, disabled and uninstalled,
I tried this but not working like below, anything I'm missing?
require_once (INCLUDE_DIR . 'class.plugin.php');
require_once ('config.php');
class MyCustomPlugin extends Plugin {
function bootstrap() {
$this->my_function() //Not working
}
function my_function() {
echo "Hello";
}
function enable() {
$this->my_function(); //not working
return parent::enable();
return false;
}
function disable() {
$this->my_function(); //not working
//return parent::disable();
}
function uninstall(&$errors) {
$errors = array();
$this->my_function(); //not working
return parent::uninstall($errors);
}