WordPress.org

Ready to get started?Download WordPress

Forums

Subscribe2
[resolved] Deactivate plugin conditionally (2 posts)

  1. aliferis
    Member
    Posted 1 year ago #

    Hello

    I need to be able to deactivate the plugin under some conditions in WP and want to do this in the WP functions file

    Can you advise ?

    Rgds

    Joe

    http://wordpress.org/extend/plugins/subscribe2/

  2. mattyrob
    Member
    Plugin Contributor

    Posted 1 year ago #

    @Joe,

    I suspect you just need to know how to activate and deactivate plugins in code. It seems you do it like this:

    if ( is_plugin_active('plugin-folder/plugin-name.php') ) {
        deactivate_plugins( '/plugin-folder/plugin-name.php', true );
    }

    To activate it's like this:
    activate_plugins( '/plugin-folder/plugin-name.php' );

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags