Membership products give you the ability to define access to posts, pages, and other content based on whether the user has been assigned a specific membership.
“Products” is a loosely defined term that can fit a variety of applications based on your need. In general, you can think of it as a defining tag that you can use to assign a user access to content. If the user has a specific membership product they can access content set to require that membership product.
Creating a new membership is much like creating a post. Just click the “Add New” button at the top.
For a new membership product, just enter a title. The slug will be created automatically from the title. Note that it’s best to create the product with just the title first. If you need a custom slug that is different from the title, I would recommend changing it after you’ve created the product.
You can create a membership that requires a specific role by checking that a role is required. When you check to require a role, a role selector will display so you can set the required role.
Memberships can expire. If you set a membership to expire, it will display two additional fields – one for the number of periods and the other to define the period. For example if the membership will run for 1 month, set “1” in the number of periods and select “month” from the period dropdown.
Click a membership from the memberships table to edit the properties of a membership. Selecting a membership will bring you to the membership editor screen (see the screenshot for Add New Product – it is the same screen when editing).
Assigning Memberships to Content
To set a post, page, or other content to require a membership to access, you can do this in the post editor. In the upper right were the WP-Members post restriction meta box is, you will see the option to “Limit access to:” followed by a selector for memberships. You can list a single membership or you can list multiple memberships. In the case of multiple assigned memberships, the user will need to have a current and valid membership for one of the assigned memberships.
Managing User Access
You can manually enable or disable a user’s membership product access in the user’s profile. In the Product Access section, select to “Enable” or “Disable” the desired membership and update the profile.
To automate access and/or to integrate with registration or other plugins, there are two API functions for adding or removing memberships for a user:
WP-Members will automatically check to see if a user has access to content when that user tries to access. However, for custom applications and integrations, the following API function can be used to check if a user has access or not:
Memberships are flexible. They are defined as a Custom Post Type (CPT) so you can integrate and customize how to assign access to users. You can sell memberships through an ecommerce product and link memberships (more information on API functions, actions and filters for integration will be forthcoming).
You can easily sell memberships through WooCommerce using the new WP-Members Memberships for WooCommerce extension. This extension will allow you to link a WP-Members membership in a WooCommerce product. If a membership is linked to a WooCommerce product, when the user purchases that product, the user will have that membership assigned to them and will then be able to access content set to require that membership.