Workflow for free (but approval-required) protected content site

Hi –

I’m trying to create a simple forum site, using WordPress Multisite + bbPress plugin, with the following workflow:

* User visits site, some pages are public, some are protected with a message “you must sign up to view more”

* User completes a basic form, receives an auto email saying “your application is pending”

* The User account in WP gets created, but assigned to some custom role that has no privileges, other than the “you must sign up” message should say “your signup is pending”

* Site admin gets an email alert saying there has been a sign up to approve/deny

* Site admin can deny user, or approve, via a web link to WordPress

* If approved, the User is moved to a new forum Role that can view the protected content

* Approved User gets an email letting them know they have been approved with a link to the site

No payment is required at any point, and their subscription to the site should not expire (unless manually edited by a Site admin)

After reading this, do you think that the Protected Content plugin can help with some/all of these requirements? It seems like (with the add-ons) it should be able to do most of it…

Thanks for any advice you can give!

  • Patrick
    • Support Monkey

    Hi there @twiginteractive

    I hope you're having a great day!

    The Protected Content plugin can easily handle all the membership requirements you have noted above, including manually adjusting user roles/capabilities & moving to different memberships.

    However, there is no specifically built-in feature to require manual admin approval of a new member. But that functionality can easily be accomplished by creating 2 memberships:

    – a free membership with very restricted access and a set role (or restricted capabilities).

    – a 2nd membership with full access and the desired role (or extended capabilities) that is set to Private so it does not show on the signup page (see screenshot below).

    Then customize the email that is sent to the new user upon registration to your free membership, including a notice that they have very limited access until approved by an admin. Check the box at the bottom of the form so the admin gets a copy of that email (screenshot).

    Once a member registers on the free membership (the only one visible to users on your signup page), the site admin would receive an email alerting them to the new registration. They then go to the site and approve/reject the user.

    Or you could try a plugin like New User Approve:

    I have not tested that myself with Protected Content, but it might prove useful. :slight_smile:

  • twiginteractive
    • Design Lord, Child of Thor


    Thanks so much for the quick response & detailed reply! Sounds like a winner. Just a couple more questions, if that’s ok.

    Do the Protected Content “Memberships” correspond to WP Roles, or are they separate meta entries? Here’s why I’m asking…

    I like to use Gravity Forms for my WP forms, and their User Registration add-on means I can collect a new user registration (including custom meta fields that will fill their profile page) – and then assign them to any WP Role.

    If the PC Membership levels are WP Roles, I could use GForm to take the initial registration and assign the User to the “free” limited PC Membership level… then the admin can log in & approve, and change their Membership to the “full” Membership level.

    Second (related) question – what hooks do the email sending actions use inside PC to send the “subscription approved” emails? Do they fire each time the user’s Membership is changed, or just when they register through PC?

    I’m wondering how we could trigger the sending of the “you have been approved” email to the User if the admin waits, say, a week to approve their account?

    Sorry if this is confusing – I really appreciate the help thinking this through.

  • Patrick
    • Support Monkey

    Hi again @twiginteractive

    I hope you're well today!

    As the Protected Content plugin has now been replaced by Membership2, all references will be to that new plugin's settings. Don't worry, they're identical as M2 is actually the revamped version of PC. :slight_smile:

    Do the Protected Content "Memberships" correspond to WP Roles, or are they separate meta entries?

    There is an addon you can activate that enables you to assign any WP role(s) you want to each membership: Member Capabilities (screenshot below). There is even an additional setting in the addon that enables you to assign individual capabilities to each membership if you really want to tweak things.

    Once activated, you'll see new options under Membership2 > Protection Rules > User Roles. If you activate the Advanced Settings of that addon, you'll see Capabilities there instead (screenshot).

    As for the hook used to trigger the email, I'm not quite sure about that one actually. However, in Membership2, you'll find full developer documentation where all the actions, filters & other fun stuff are fully detailed. See under Membership2 > Help > Advanced Settings

  • twiginteractive
    • Design Lord, Child of Thor

    Hi again – I’ve gotten very close to my goal using Membership2, Gravity Forms and the New User Approve plugins.

    The one remaining issue is assigning a Membership via a PHP call (instead of using the Membership2 workflow).

    The “User Roles” add-on is great, but it only does the reverse of what I need: it adds a Role to a user that belongs to a Membership. What I need is to do is the opposite: I need a user of a certain Role to be added to a Membership!

    Basically, I’m not using Membership2 to perform the registration – I’m just using it to control content access. So, I am looking for the PHP hook (or API info) to add a user (via their UserID or $WP_User object) to a Membership. This Membership group is free, and doesn’t expire. Right now if I manually go to the -> Members settings page and add a user, it works. I’m looking for the PHP call to do it programmatically.

    Can you point me in the right direction? Can I perhaps just use the same Ajax call that the page uses? These user approvals will always be done by a logged-in Admin.

    Thanks for any direction you can give.

  • twiginteractive
    • Design Lord, Child of Thor

    In case my reply above was confusing… I’ve looked at the Membership2 API and I can see there is a function for get_memberships().

    What I need is a “set_membership()” function that I can pass a user ID and a membership ID, and add that user to that Membership. I can’t believe an API wouldn’t have that feature?!

  • Sajid
    • DEV MAN’s Sidekick

    Hi @twiginteractive! hope you are doing good today :slight_smile:

    I am going to flag SLS (second level support) for their invaluable feedback on this matter and can provide a hook or function to set membership. Meanwhile, in API documentation, I found this function “add_membership()”, that you can try to set a membership.

    For user role add on we can also set it the way you want when we have correct hook/funciton to set membership.

    Take care and have a nice day :slight_smile:

    Cheers, Sajid

  • twiginteractive
    • Design Lord, Child of Thor

    Thanks! I was looking in the Model_Relationship class because that links the users and the memberships, but I think from your tip I can request a Model_Member instance for the user in question, then call add_membership() with the $membership_id and it should add it.

    Please do have an SLS check this question out, but I’ll continue trying myself too. I must have been working too late last night not to see that function name in the API :slight_smile:


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.