Hi,
I am adding some plugins functions in our themes. Now, when the theme is activated in a site where the plugin is already activated, fatal errors occur due to the declaration of the same functions – both in the theme as well in the plugin. Now I wish to deactivate the plugin when the theme is activated because the theme itself has those functions in it. I tried with this
function deactivate_dfe() {
if( is_plugin_active('divi-footer-editor/divi-footer-editor.php') ){
deactivate_plugins('divi-footer-editor/divi-footer-editor.php');
}
}
add_action( 'admin_init', 'deactivate_dfe' );
But that does not deactivate the plugin Divi Footer Editor and hence I get the fatal errors. Any suggestion
PS: I am the author of both the plugin and the theme
( @Alen I think you can surely help me here as well. Thanks)
Thanks
Kalyan