Skip to content

Instantly share code, notes, and snippets.

@wp-kitten
Created March 31, 2015 09:23
Show Gist options
  • Save wp-kitten/2bf444f0cc10bd06bf4e to your computer and use it in GitHub Desktop.
Save wp-kitten/2bf444f0cc10bd06bf4e to your computer and use it in GitHub Desktop.
WordPress Theme Activation/Deactivation hooks
<?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