Skip to content

Instantly share code, notes, and snippets.

@JamesVanWaza
Created May 13, 2015 14:19
Show Gist options
  • Save JamesVanWaza/d5cc272633d9a6d955ec to your computer and use it in GitHub Desktop.
Save JamesVanWaza/d5cc272633d9a6d955ec to your computer and use it in GitHub Desktop.
Wordpress Activate and Deactivate Functions
<?php
//Add Activate Button
function my_plugin_activate(){
//db create, create options, etc
error_log('My plugin activated');
}
register_activation_hook(__FILE__, 'my_plugin_activate');
//Add Deactivate Button
function my_plugin_deactivate(){
//db create, create options, etc
error_log('My plugin deactivated');
}
register_deactivation_hook(__FILE__, 'my_plugin_deactivate');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment