Created
January 7, 2021 07:27
-
-
Save andrewlimaza/61f37ba8f4a54d2883d6ea19d673f505 to your computer and use it in GitHub Desktop.
Give members immediate access to Series content [Paid Memberships Pro]
This file contains 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 characters
<?php | |
/** | |
* Give user's with a certain level access to all Series without waiting. | |
* Adjust the $all_access array with level ID's you want this to apply to. | |
* To add this code to your site, please follow this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_give_members_immediate_access_to_all_series_content( $drip, $member_days, $delay, $user_id ) { | |
$user_level = pmpro_getMembershipLevelForUser( $user_id ); | |
$all_access = array( 1,2,5 ); | |
if ( in_array( $user_level->id, $all_access ) ) { | |
$drip = 1; //Set content available from day 1. | |
} | |
return $drip; | |
} | |
add_filter( 'pmpro_series_override_delay', 'my_give_members_immediate_access_to_all_series_content', 10, 4); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please note that the email may still go out with the default settings of accessing the content. This is to override access to the websites restricted content.