Deactivate Plugin on Theme Switch
I haven’t tested this, so it might not work correctly, but the essence of what you’re trying to do is hook into the after_switch_theme hook and see if the $old_name is DahTheme. If it is, that means that the current theme isn’t DahTheme, so you want to deactivate the plugin. function wpse_after_switch_theme( $old_name, $old_theme ) … Read more