How it Works
- Admin designates a post as an “addon package” by setting a price for access and selecting which membership levels can purchase the package.
- For users without access, the page will show the excerpt and a link to purchase at the bottom of the page.
- For users with access, the page will chose the full page/post content (content after the “more” tag).
- Set the global
PMPROAP_EXP_DAYSto optionally define an expiration term for all addon packages (i.e. 7 days)
- Use the filter
pmproap_all_access_levelsto define the level(s) that have “all access”. [more]
This is a workaround if you would like to allow multiple membership levels per user.
- Upload the ‘pmpro-addon-packages’ directory to the ‘/wp-content/plugins/’ directory of your site.
- Activate the plugin through the ‘Plugins’ menu in WordPress.
- Edit a post or page to designate it as an addon package and set the price.
- (optionally) create the “Shop” page using the [pmpro_addon_packages] shortcode.
The [pmpro_addon_packages] shortcode allows you to display a “shop” like page of available addon packages (all pages and posts with a defined
pmproap_price). Just add the shortcode to a page with your desired attributes.
- checkout_button: The text displayed on the button linking to checkout. (default: “Buy Now”).
- exclude: A comma-separated list of the page IDs to exclude from display (default: none).
- include: Optionally set this attribute to only show subpages of the active page. Accepts: “subpages”. (default: shows all pages and posts with an addon package price).
- layout: The layout of the output. (default: table). Accepts “div”, “table”, “2col”, “3col”, “4col” (column-type layouts will work with the Memberlite Theme or any theme based on the Foundation 5 grid system).
- link: Hyperlink the post/page title to the single view; accepts “true” or “false” (default: true).
- orderby: Accepts any orderby parameter as defined in the codex. (default: menu_order).
- order: Accepts ASC or DESC as defined in the codex. (default: ASC).
- thumbnail: Optionally hide or show the subpage’s featured image; accepts “thumbnail”, “medium”, “large” or “false”. (default: thumbnail).
- view_button: The text displayed on the button linking to view the single page. (default: “View Now”).
Screenshots and Code Examples
Four Column Layout
[pmpro_addon_packages layout="4col" orderby="post_title" thumbnail="thumbnail"]
[pmpro_addon_packages layout="table" orderby="post_title" thumbnail="thumbnail"]
Different cases for different users
- If the current user has already purchased the addon package, they will see a link to “View”.
- If the current user has a valid membership for the addon package, they can purchase without modifying their membership level.
- If the current user does not have a membership level or there is no current (not logged in), they can click the “buy” button to purchase membership and the addon package in one step.
This function works similar to the
pmpro_hasMembershipLevel function included in the core Paid Memberships Pro plugin. The function allows you to require the logged in member has purchased a specific Addon Package (by post ID). You can use the function to restrict content in a template file, custom plugin, or to build a custom web application.
You will need to know the
$user_id of the user to check and the
$post_id of the post to check. The function returns
true if the user has access to the post,
false if not.
All Access Levels
If you would like to define specific membership levels that have access to all Add-on Packages without requiring additional payment, us the pmproap_all_access_levels filter:
Addon Packages only works for a one-time charge (no recurring payments on a single content purchase). You also cannot currently apply tax or discount codes to the addon package purchase.