• I have been able to get this plugin to work just fine with users who are registered in the sub blog. However, now I am now trying to log in users who are paid members and only tracked and controlled within the main blog. Adding the user to (or having them join) the sub blog will lose the data needed for their membership level. How can I hook in to your plugin and switch the blog id to 1 so all users credentials are verified from there?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter stoi2m1

    (@stoi2m1)

    I have tracked down the problem and wonder if there is a way you could integrate an option into your plugin for my situation. I would prefer an option of editing the core of the plugin, this way I can update as needed.

    I am using a membership plugin which grants access to sub sites based on members only singing up for thing main site.

    This condition keeps my members from gaining access to the sub blog using this plugin.

    if (!is_user_member_of_blog($user->ID)) {
            return new WP_Error('api_api_bearer_auth_wrong_blog',
              __('You are no member of this blog.', 'api_bearer_auth'), ['status' => 401]);
    }

    It seems you do not have an admin page for options, but maybe a constant could be defined in the wp-config.php file for this. Maybe something like

    define(THIRD_PARTY_ALLOW_MULTISITE, true);

    then the condition could be something like this

    if (!is_user_member_of_blog($user->ID) && !THIRD_PARTY_ALLOW_MULTISITE) {
            return new WP_Error('api_api_bearer_auth_wrong_blog',
              __('You are no member of this blog.', 'api_bearer_auth'), ['status' => 401]);
    }

    If you have a better solution that may help me please let me know.

    Plugin Author michielve

    (@michielve)

    Hi,

    I’m not sure if I understand your situation exactly.

    You have users that are members of the main blog only, but you still want them to give access to sub sites with this plugin?

    BW

    Thread Starter stoi2m1

    (@stoi2m1)

    Yes, that is exactly what I want to do.

    They are paid members tracked within the main blog and only within that blog. Syncing that data across all blogs would not only be nightmarish but also redundant. So, the membership plugin I use allows them access to data based on a membership level not which blog they are a member of. I have code that doesnt send all data from the API unless they are of a certain membership level and you plugin returns an error “not a member of this blog” before I can return the proper data based on membership.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WordPress MU with Memberships Tracked in Main Blog’ is closed to new replies.