Created
March 31, 2015 09:23
-
-
Save wp-kitten/2bf444f0cc10bd06bf4e to your computer and use it in GitHub Desktop.
WordPress Theme Activation/Deactivation hooks
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 this code to your theme's functions.php file | |
*/ | |
// Theme activation | |
add_action("after_switch_theme", "theme_activated"); | |
function theme_activation_hook(){ | |
error_log('theme activated'); | |
} | |
// Theme deactivation | |
add_action('switch_theme', 'theme_deactivated'); | |
function theme_deactivation_hook () { | |
error_log('theme deactivated'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment