Our Addon Packages extension allows you to sell access to individual pages or posts for a flat fee. This can be used in creative ways, such as Webinar sales, individual file downloads or e-Learning Courses. This code recipe explains how to set specific membership levels as “All Access”.

All Access Levels
If you would like to define specific membership levels that have access to all Addon Packages without requiring additional payment, use the pmproap_all_access_levels
filter:
/** * Set levels as "all access levels" so members of these levels will be able to view all Addon Packages. * Requires Paid Memberships Pro and the pmpro-addon-packages plugin. * * title: Give Membership Level(s) to all Addon Packages * layout: snippet * collection: addons * category: pmpro-addon-packages * link: https://www.paidmembershipspro.com/allow-specific-membership-levels-to-view-addon-packages-and-require-others-to-pay/ * * You can add this recipe to your site by creating a custom plugin * or using the Code Snippets plugin available for free in the WordPress repository. * Read this companion article for step-by-step directions on either method. * https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ */ function my_pmproap_all_access_levels( $levels, $user_id, $post_id ) { //I'm just adding the level, but I could do some calculation based on the user and post id to programatically give access to content $levels = array( 16 ); return $levels; } add_filter( 'pmproap_all_access_levels', 'my_pmproap_all_access_levels', 10, 3 );
Adding the Recipe to Your Website
You can add this recipe to your site by creating a custom plugin or using the Code Snippets plugin available for free in the WordPress repository. Read this companion article for step-by-step directions on either method.