OK don't want/need Membership on my primary site, only on sub-sites (on demand)

I’m currently playing around with Membership on one of my MU installs which is set up as detailed here using the Global WPMU access (activates on all blogs in the install) – basically throw everything in ‘mu-plugins’ – BUT its not quite what I need and after reading a LOT of posts around here, I’m wondering of what I need IS in fact possible :slight_smile:

BASICALLY – I don’t need Membership enabled on all of my sites in the network and ESPECIALLY not on my main, admin-root blog/site – its really not needed here.

I only need the plugin to work on sub-sites where users want to run membership features. For users who are admins of their own sites and NOT super-admins and without any interaction of membership levels or users across sites. IS this possible? If so, how? :slight_smile:

Do I need to install as a standard WP plugin and just get the user to ‘enable’ from their backend? From what I’ve read, I’m not sure it will show up because of the security features in the plugin around super-admin users?

Last note: I’m currently experimenting with the MP Blog Register plugin which fixes the issue of users registering for single-sites – it looks perfect, I just need clarity on Membership before I port this over to my live MU network.

tl;dr – I have membership set up network-wide, only need it on selected blogs in the network and definitely not on the root site :wink:

  • Mason
    • DEV MAN’s Sidekick

    Hiya Michael,

    As far as I can tell, you are right on all counts. Yes, you can install Membership in your plugins folder and then activate it on any sub-site you like (it will then only apply membership rules to that sub-site).

    You could make the plugin one that ‘auto-activates’ as part of the Supporter package if you like, but you will need to add the usernames individually to the membership-config file in order for them to see the admin menus.

    I’ll ask Barry to comment on this as well as I may have left something out, but I believe using it this way will get you the results your after.

    Thanks!

  • Michael Kimb
    • Design Lord, Child of Thor

    Thanks Mason,

    After much tinkering and throwing files around I think I’ve cracked what I need maybe 90%. Its not how I designed it in my head, but it works for now.

    Now for a DB/server clearout and re-install :slight_smile: *joy*

  • Barry
    • DEV MAN’s Mascot

    You could make the plugin one that ‘auto-activates’ as part of the Supporter package if you like, but you will need to add the usernames individually to the membership-config file in order for them to see the admin menus.

    You need to add a capability to each user that wants to admin the membership system – though if you are running it on a site by site basis and want the admin user for each site to have full control of the membership plugin (i.e. you aren’t actually using the plugin to restrict which menus / plugins / etc… are available) then you can create small plugin to go in mu-plugins that has the following:

    <?php

    add_action('user_register', 'm_add_user_cap', 10, 1);

    function m_add_user_cap( $user_id ) {

    $user = new WP_User( $user_id );

    if(!empty($user) && method_exists($user, 'has_cap') && $user->has_cap('administrator') && !$user->has_cap('membershipadmin')) {

    $user->add_cap('membershipadmin');

    }

    }

    ?>

  • Nu Eranet
    • Flash Drive

    Hi Barry and Mason,

    I’ve been reading the forum posts and I am hoping maybe there is a solution out there that will work for me.

    Setting up a membership based web site. To help people market online. I would like the setup to be very similar to what you have going with wpmudev. That is people can see content to some extent but they are limited to accessing the backend and downloads.

    The next part of the membership is to offer members a sub-domain based web site. I will create a template site in the multi site set up. That will be the master template for all the other sub-domain sites.

    1- Is there a way to use the Membership Plugin to manage the main site, control the protected content and then allow members to manage or be administrator for their own sub-domain site and still be able to login to the main site and to access the training material?

    2- What plugins do you recommend using to be able to manage all this?

    3- would it be wiser to have two separate domains one as the main site with the membership training and the second to manage all the sub-domain sites. Is it possible to be able to use the same usernamesand passwords for both access points.

    Thank you

  • Barry
    • DEV MAN’s Mascot

    Adding the capability in the code snippet above to a new admin user will allow the membership plugin to be controlled by that user – so putting that bit of code in a php file (with any name) should give new admin users the capability required.

    The other method is to change the word “membershipadmin” to “administrator” throughout the plugin – should only be in two of the files.

    I’m going to add a configuration value for this in an updated version, but it won’t be for a while yet as there are a few other things in development for it that we need to get complete.

    @nueranet – that really is a different topic to the post you’ve appended it to, and would be better in a separate thread where it would get more attention.

    But 1. is the default behaviour as far as i understand your post.

  • jozwikjp
    • The Incredible Code Injector

    Wouldn;t that code example instead assign all users to be membership_master_admin’s though?

    Hi Mike,

    So different users of the blog would automatically be the membership admin because the plugin is activated for that blog?

    That would be undesirable if that is the case.. :slight_smile:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.