Members custom posts

Hi, can you point me to the doco on how to create a membership site, where the member can create posts of a custom post type.

Ie a member subscribes and can publish a post that is a custom post type?

Thanks
Matt

  • Adam Czajczyk
    • Support Gorilla

    Hello Matt

    I hope you're well today and thank you for your question!

    I think in this case you'd need to start with making sure that your custom post type that's going to be made available to those users is registering a "custom capabilities". Default WP user roles do not differentiate between "regular" and custom post types so assigning e.g. "Author" user role to the members would let them manage and publish their own posts (only) but of any available post type. Therefore, there need to be "something" to make this post type unique.

    A custom capability could be such thing. If you have created your custom post type using some plugin, there might be an option to create/specify such capabilities but if not, you might need some custom coding for this. Here's a nice guide on how to address this:

    https://kinsta.com/blog/wordpress-user-roles/

    Next step would be to user our Membership 2 Pro plugin to create a membership on site. Here's you will find a usage guide on the plugin:

    https://premium.wpmudev.org/project/membership/#wpmud-hg-project-documentation

    The plugin will let you create a membership (subscription - it can be paid or free, time limited or not, recurring or "one off") and will take care of user registration, payments (if there are any) and so on.

    There's also an add-on built-in that you will need: "Member Capabilities". To enable it (once you got a plugin installed and fully configured), go to "Membership 2 -> Add-ons" and switch the toggle next to "Member Capabilities" on (to green color). You will also need to click "Details" link there and enable "Advanced Capability Protection" option.

    Then, on "Membership 2 -> Protection Rules -> Capabilities" page you will see a list of all existing capabilities. Find the one that you created/registered with your custom post type and click on "Modify access" link (when you hover over gray text) in "Who has Access" column next to it, then select your membership from the list.

    This will assign the membership to the capability. As a result:

    - user who comes to your site and registers for the membership is granted this capability
    - this capability, being custom one assigned to your custom post should let them access these custom posts editing.

    Since it's a bit complex, I'd strongly recommend giving it a go on some staging/development site to make sure that everything's working fine and only then replicating it on a live site.

    An alternative option, a bit simpler but using additional (paid) plugin, would be to use:

    - User Role Editor plugin (free) to duplicate default "Author" role (I'll call that new role "Publisher")
    - user "Admin Menu Editor PRO" to allow access to your custom post to the "Publisher" role only
    - use Membership 2 Pro with "Member Capabilities" add-on enabled but its "Advanced Capability Protection" disabled to assign "Publisher" user role to all members who register for a specific membership.

    That should be easier to setup up and provide similar result but please note that I'm not able to test it as I don't have access to "Admin Menu Editor PRO" so I'm only suggesting it based on the plugin description where it's stated that it provides admin menu access control based on user role.

    If you got any additional questions, let me know please.

    Kind regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.