Skip to:
Content
Pages
Categories
Search
Top
Bottom

bbPress gets deactivated by custom mu-function


  • dominikb
    Participant

    @dominikb-1

    Hi folks,
    i added the following code to a php file in the /mu-plugins/ folder, to deactivate a plugin for logged-in users:

    add_filter( 'option_active_plugins', 'disable_logged_in_plugin' );
     
    function disable_logged_in_plugin( $plugins ) {
    
        require (ABSPATH . WPINC . '/pluggable.php');
        if ( is_user_logged_in() & !is_admin() ) {
            $key = array_search( 'bloom/bloom.php' , $plugins );
            if ( false !== $key ) {
                unset( $plugins[ $key ] );
            } 
        }
        return $plugins;
    }

    Strangely bbPress gets also deactivated by it, while all other plugins run without any problem.

    Do you have an idea why this happens and what to change?

    Regards
    Dominik

  • You must be logged in to reply to this topic.
Skip to toolbar