You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ecorica edited this page Jul 23, 2021
·
1 revision
If you want to add hooks for activation and deactivation of the plugin you need to generate the class Plugin.php
1. Create your Plugin class
<?php
namespace BEA\PB;
/**
* The purpose of the plugin class is to have the methods for
* - activation actions
* - deactivation actions
* - uninstall actions
*
* Class Plugin
* @package BEA\PB
*/
class Plugin {
/**
* Use the trait
*/
use Singleton;
public static function activate(): void {
}
public static function deactivate(): void {
}
}
2. Add the registry activation and deactivation hook in the '.php' root file of your plugin (ex : my-plugin.php).