Created
May 13, 2015 14:19
-
-
Save JamesVanWaza/d5cc272633d9a6d955ec to your computer and use it in GitHub Desktop.
Wordpress Activate and Deactivate Functions
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 | |
//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