mirror of
https://github.com/inretio/WordPress-Plugin-Boilerplate
synced 2024-12-22 20:03:53 +02:00
Merge pull request #237 from feskehau/master
Create functions for activation and deactivation hooks.
This commit is contained in:
commit
ec4c52c115
1 changed files with 12 additions and 7 deletions
|
@ -32,19 +32,24 @@ if ( ! defined( 'WPINC' ) ) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The code that runs during plugin activation.
|
* The code that runs during plugin activation.
|
||||||
|
* This action is documented in includes/class-plugin-name-activator.php
|
||||||
*/
|
*/
|
||||||
require_once plugin_dir_path( __FILE__ ) . 'includes/class-plugin-name-activator.php';
|
function activate_plugin_name() {
|
||||||
|
require_once __DIR__ . 'includes/class-plugin-name-activator.php';
|
||||||
|
Plugin_Name_Activator::activate();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The code that runs during plugin deactivation.
|
* The code that runs during plugin deactivation.
|
||||||
|
* This action is documented in includes/class-plugin-name-deactivator.php
|
||||||
*/
|
*/
|
||||||
require_once plugin_dir_path( __FILE__ ) . 'includes/class-plugin-name-deactivator.php';
|
function deactivate_plugin_name() {
|
||||||
|
require_once __DIR__ . 'includes/class-plugin-name-deactivator.php';
|
||||||
|
Plugin_Name_Deactivator::deactivate();
|
||||||
|
}
|
||||||
|
|
||||||
/** This action is documented in includes/class-plugin-name-activator.php */
|
register_activation_hook( __FILE__, 'activate_plugin_name' );
|
||||||
register_activation_hook( __FILE__, array( 'Plugin_Name_Activator', 'activate' ) );
|
register_deactivation_hook( __FILE__, 'deactivate_plugin_name' );
|
||||||
|
|
||||||
/** This action is documented in includes/class-plugin-name-deactivator.php */
|
|
||||||
register_deactivation_hook( __FILE__, array( 'Plugin_Name_Deactivator', 'deactivate' ) );
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The core plugin class that is used to define internationalization,
|
* The core plugin class that is used to define internationalization,
|
||||||
|
|
Loading…
Reference in a new issue