Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Deactivate a plugin when the same functions are present in the theme

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #234757
    Ayanize
    Participant

    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

Viewing 1 post (of 1 total)
  • The forum ‘Back End’ is closed to new topics and replies.