Skip to content

Instantly share code, notes, and snippets.

@andrewlimaza
Created January 7, 2021 07:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewlimaza/61f37ba8f4a54d2883d6ea19d673f505 to your computer and use it in GitHub Desktop.
Save andrewlimaza/61f37ba8f4a54d2883d6ea19d673f505 to your computer and use it in GitHub Desktop.
Give members immediate access to Series content [Paid Memberships Pro]
<?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);
@andrewlimaza
Copy link
Author

andrewlimaza commented Apr 24, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment