after_switch_theme is triggered on the request immediately following a theme switch.
Theme functions attached to this hook are only triggered in the theme (and/or child theme) being activated. To do things when your theme is deactivated, use switch_theme.
<?php add_action("after_switch_theme", "mytheme_do_something"); ?>
Add options for your theme and set them to their default values.
add_action('after_switch_theme', 'mytheme_setup_options'); function mytheme_setup_options () { add_option('mytheme_enable_catalog', 0); add_option('mytheme_enable_features', 0); }
after_switch_theme action hook is located in wp-includes/theme.php