mirror of
https://github.com/inretio/WordPress-Plugin-Boilerplate
synced 2024-12-22 20:03:53 +02:00
Merge pull request #7 from tylerdigital/master
Added activation/deactivation hooks to Constructor
This commit is contained in:
commit
0957a12af4
1 changed files with 17 additions and 0 deletions
17
plugin.php
17
plugin.php
|
@ -58,6 +58,9 @@ class PluginName {
|
||||||
// Load JavaScript and stylesheets
|
// Load JavaScript and stylesheets
|
||||||
$this->register_scripts_and_styles();
|
$this->register_scripts_and_styles();
|
||||||
|
|
||||||
|
register_activation_hook( __FILE__, array( &$this, 'activate' ) );
|
||||||
|
register_deactivation_hook( __FILE__, array( &$this, 'deactivate' ) );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TODO:
|
* TODO:
|
||||||
* Define the custom functionality for your plugin. The first parameter of the
|
* Define the custom functionality for your plugin. The first parameter of the
|
||||||
|
@ -74,6 +77,20 @@ class PluginName {
|
||||||
|
|
||||||
} // end constructor
|
} // end constructor
|
||||||
|
|
||||||
|
function activate($network_wide) {
|
||||||
|
/*
|
||||||
|
TODO define activation functionality here
|
||||||
|
$network_wide is true if WPMU superadmin uses "Network Activate" action, false if WPMU is disabled or plugin is activated on an individual blog
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
function deactivate($network_wide) {
|
||||||
|
/*
|
||||||
|
TODO define deactivation functionality here
|
||||||
|
$network_wide is true if WPMU superadmin uses "Network Deactivate" action, false if WPMU is disabled or plugin is deactivated on an individual blog
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
/*--------------------------------------------*
|
/*--------------------------------------------*
|
||||||
* Core Functions
|
* Core Functions
|
||||||
*---------------------------------------------*/
|
*---------------------------------------------*/
|
||||||
|
|
Loading…
Reference in a new issue