Membership Plugin - One Account, Access to Multiple Sites

I am working with some small, community newspapers. They are wanting to sell digital subscriptions where a user can subscribe to one or more paper. The intent is to have a single account (SSO) so that once the user logs into Paper One, if they visit Paper Two they do not need to login again.

Does Membership do this?

Also, I am having difficulty learning how to use the Membership Plugin to protect content. Do I need to use shortcodes or modify my WordPress themes to make that happen? In addition, would I need to write something separate to allow for posts which are >2 weeks old to be accessible without being a subscriber?

(Lots of questions, I know. But the documentation for this plugin didn't provide me with a great deal of information to work from.)

  • James Morris

    Hello Luke,

    I hope you are well today.

    The intent is to have a single account (SSO) so that once the user logs into Paper One, if they visit Paper Two they do not need to login again.

    This can be accomplished but will require a bit more than just Membership 2. Please see the following thread for information on how to accomplish this: https://premium.wpmudev.org/forums/topic/login-to-all-multisites

    Also, I am having difficulty learning how to use the Membership Plugin to protect content. Do I need to use shortcodes or modify my WordPress themes to make that happen?

    There's a few different ways you can protect content. This can be done with shortcodes, in the individual pages/posts, in the Admin -> Membership 2 -> Protection Rules section, and through add-ons in the plugin that allow you to protect media and other special pages. If you see the product usage page for the plugin, multiple examples are given on how to enable protection using different methods: https://premium.wpmudev.org/project/membership/#product-usage

    Basically, you can use either the global settings, individual post/page settings on the post/page editor, shortcodes, template modifications or any combination of the above.

    In addition, would I need to write something separate to allow for posts which are >2 weeks old to be accessible without being a subscriber?

    This would require a little bit of custom code, but it's not particularly difficult. You would want to create a custom template for the posts/pages you want to protect with old content and use the do_shortcode() function to wrap your loop with the Membership 2 protection shortcodes. It would look something like the following:

    <?php
    global $post;
    if ((strtotime($post->post_date) < strtotime('-14 days')) && is_single()) {
    echo do_shortcode( '[ms-protect-content id="24"]' );
    
    //Your custom Loop here!
    
    echo do_shortcode( '[/ms-protect-content]' );
    
    }?>

    I hope this clarifies a bit.

    Best regards,

    James Morris

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.