Is it possible to stop a theme activation when a certain plugin is not activated
Using after_switch_theme will activate the theme (which is fine as we want to run the check within the context of the new theme). If the dependencies are not fulfilled ($missing_dependencies = true;) we’re instantly switching back to the theme previously used (passed via after_switch_theme and $oldtheme). add_action( ‘after_switch_theme’, ‘check_theme_dependencies’, 10, 2 ); function check_theme_dependencies( $oldtheme_name, … Read more