Forked from markjaquith/activate-deactivate-uninstall-example.php
Created
March 3, 2014 23:22
-
-
Save wpsmith/9336777 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Change /*CUSTOMIZE_THIS*/ to a unique name (two places). Go ahead, make it long. | |
// Like, your initials, and your full plugin name. | |
// e.g. MTJ_Some_Awesome_Plugin_Controller | |
/*CUSTOMIZE_THIS*/_Controller::init(); | |
class /*CUSTOMIZE_THIS*/_Controller { | |
function init() { | |
register_activation_hook( __FILE__, array( __CLASS__, 'activate' ) ); | |
register_deactivation_hook( __FILE__, array( __CLASS__, 'deactivate' ) ); | |
} | |
function activate() { | |
// Add options, initiate cron jobs here | |
register_uninstall_hook( __FILE__, array( __CLASS__, 'uninstall' ) ); | |
} | |
function deactivate() { | |
// Remove cron jobs here | |
} | |
function uninstall() { | |
// Delete options here | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment