Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to block access to specific groups based on membership


  • shirleyddsn
    Participant

    @shirleyddsn

    I’m working on a membership site where there are free memberships and paid subscriptions. Members with certain subscriptions would have access to certain groups while everyone else would not.

    I purchased WooCommerce Memberships and Subscriptions in order to accomplish this, only to find out that I can’t restrict exact URI like I thought I could. I need to be able to restrict exact URIs so I can list out exactly which groups go with which subscriptions. Right now the only option I have to restrict the whole groups directory, which is not what I want at all.

    Does anyone have any suggestions or ideas on how I can get this done? I know (or at least think) that MemberPress offers this option, but WooCommerce offers more in terms of add-ons that go along with what I want my site to offer long-term. Such as Events and Bookings. I’m not sure if MemberPress would play well with WooCommerce, and I’d also rather not spend another $200 on another plugin, when all I need is the URI restriction.

    Any ideas?
    Shirley D.

Viewing 8 replies - 1 through 8 (of 8 total)

  • Henry Wright
    Moderator

    @henrywright

    Hey @shirleyddsn

    Which URLs do you need to restrict access to?


    shirleyddsn
    Participant

    @shirleyddsn

    The URLs to specific groups that would only be accessible by certain subscriptions.

    For example, someone with a Artist subscription could access
    http://www.mywebsite.com/groups/TheArtGroup

    someone with a Vocalist subscription could access
    http://www.mywebsite.com/groups/VocalistsUnite

    but the Artist couldn’t access the URL (or see the content) for Vocalists Unite without a Vocalist subscription, and the Vocalist couldn’t access The Art Group without an Artist Subscription.

    Am I making sense?


    Henry Wright
    Moderator

    @henrywright

    You can do this:

    if ( bp_is_groups_component() && 'group-name-here' === bp_current_item() ) {
        // Restrict access
    }

    shirleyddsn
    Participant

    @shirleyddsn

    @henrywright
    Oh, ok. And so I would create a line of code (I’m assuming in my bp-custom.php?) for each group that I create and want to block access to? Sounds great!.

    I’m trying to understand how I accomplish this with the WooCommerce Membership plugin I’m using. Would I use do_shortcode() along with the given parameters for the WooCommerce shortcode? And how would that display on the page? I guess maybe just show the restriction message . . .

    Unfortunately, I don’t have time this weekend to play around with this, but I’ll have a go at it some time around Monday, and I’ll be sure to let you know how things go.

    THANK YOU SO MUCH for getting back to me. I was starting to get really frustrated with this =)


    Henry Wright
    Moderator

    @henrywright

    Let me know how you get on on Monday and feel free to post questions if you get stuck.


    johnriggs78
    Participant

    @johnriggs78

    Hello Shirleyddsn,

    If you have still problem you can try WordPress Lock for BuddyPress , I faced same problem for my personal blog, But now i am happy :).


    swiggle
    Participant

    @swiggle

    is ther a way to auto remove someone from a group if their membership/subscription expires or doesnt renew?


    mom4321
    Participant

    @mom4321

    hey! I have tried your suggestion and it’s really good.

    Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Skip to toolbar