Controlling Plugins and theme options via The Admin addons for membership 2 Pro

This is a follow up to sales conversation with me (tom) if you need any further background please send me a message.

My next question is regarding plugins and themes. I only have an option to “Network Activate” plugins. This is kind of a problem because I’m noticing that all sites within my network and see all activated plugins and themes. I only want them to see the plugins that are for their site and the theme(s) for their site.

Currently I tried installing the Membership 2 plugin and I’m looking to use that Admin Side addon. Not sure if that will accomplish what I needed (im still reviewing it), but wasn’t sure if there was another way.

Finally, is there a Single Sign On option with Membership 2?

My goal is for when people sign up for hosting via WHMCS provisioning/integration… that an automatic membership be created as well for that user, so they won’t have to regsiter all over again separately…

Just want to ensure I’m doing this right…

Again, I want them to come to my site, choose the hosting package and also have a mebmership set up. I chose default mebmership, since I’m currently not charging for memberships….

  • Ivan Shulev
    • The Bug Hunter

    Hey Jerone ,

    I hope you are having a nice day so far!

    I only want them to see the plugins that are for their site and the theme(s) for their site.

    This can be achieved with our Pro Sites plugin and its Premium Themes and Premium Plugins modules.

    My goal is for when people sign up for hosting via WHMCS provisioning/integration… that an automatic membership be created as well for that user, so they won’t have to regsiter all over again separately…

    Since I assume your members will be using subsites and you will have Pro Sites enabled, I can offer you the following script which you will need to add either as a must-use plugin or insert it in any custom code plugin:

    function wpmu_5433_assign_membership() {
    global $psts;
    $blog_id = get_current_blog_id();
    $pro_sites_level = 2;
    if($pro_sites_level == $psts->get_level( $blog_id )) {
    $uids = get_users(
    array(
    'blog_id' => $blog_id,
    'role' => 'administrator',
    'fields' => 'ID',
    'order_by' => 'ID',
    //No need for super admin
    'exclude' => array(1),
    'order' => 'ASC',
    )
    );
    //Make sure there are users and MS has initiated
    if ( apply_filters( 'ms_active', false ) && isset($uids[0])) {
    $api = ms_api();
    $subscription = null;
    //Membership IDs
    $memberships = array(1417);
    $current_member = $api->get_member($uids[0]);
    $assigned_ids = $current_member->get_membership_ids();
    switch_to_blog(1);
    if(is_array($assigned_ids) && !empty($assigned_ids)) {
    foreach ( $current_member->get_membership_ids() as $old_id ) {
    if ( !in_array( $old_id, $memberships ) ) {
    $current_member->drop_membership( $old_id );
    foreach ($memberships as $new_id) {
    $subscription = $current_member->add_membership($new_id);
    }
    }
    }
    }
    else {
    foreach ($memberships as $new_id) {
    $subscription = $current_member->add_membership($new_id);
    }
    }
    restore_current_blog();
    }
    }
    }
    //This action is fired if the current site has an active level
    add_action('psts_active', 'wpmu_5433_assign_membership');

    You will have to change the membership id (in this case its 1417) and pro sites id (in this case 2).

    You are more than welcome to ask more questions! We will be happy to assist you further :slight_smile:

    I hope this helps and I wish you an awesome day ahead!

    Ivan