Created
November 23, 2018 09:31
-
-
Save andrewlimaza/e8c29d047ba6e7dcbe4a8261c7e8404b to your computer and use it in GitHub Desktop.
Revisions
-
andrewlimaza created this gist
Nov 23, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ <?php /** * Give "All Access" to PMPro Series for specific membership level. * Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ */ function open_series_to_specific_level($hasaccess, $thepost, $theuser, $post_membership_levels) { // Bail if the user already has access to a post/page. if ( $hasaccess ) { return $hasaccess; } if ( pmpro_hasMembershipLevel( 1 ) && $thepost->post_type == 'pmpro_series' ) { // Change level ID to match levels for all access. $hasaccess = true; } return $hasaccess; } add_filter("pmpro_has_membership_access_filter", "open_series_to_specific_level", 10, 4);