Last active
March 14, 2022 09:07
-
-
Save strangerstudios/7806245 to your computer and use it in GitHub Desktop.
PMPro Adjust start date to the first following Sunday.
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 characters
/* | |
Adjust start date to the first following Sunday | |
*/ | |
//at checkout | |
function my_pmpro_checkout_start_date($startdate) | |
{ | |
//which day is it | |
$checkout_day = date("N"); | |
//days to sunday | |
$days_to_sunday = 7 - $checkout_day; | |
//add the days | |
$startdate = date("Y-m-d", strtotime("+ " . $days_to_sunday . " days")); | |
return $startdate; | |
} | |
add_filter('pmpro_checkout_start_date', 'my_pmpro_checkout_start_date'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@stranderstudios First ... thanks.
Second, I'm a total newbie.
2 things, how would I get new purchasers to only get access to the content on the first monday of the month, then drip out content every 7 days? I attached images, so hopefully this will make sense.
person buys on the 9th of the month. and, on the following First Monday of the Next Month, somehow I'll email them login credentials (via InfusionSoft) and when they login the first time, they gain access to "week 1 access" and all of the pages built there. Then, 7 days later, they can access "week 2 access" and all of the pages / videos associated with that week. Then, so on until they complete the 4 week training.
As you can see, I'm building this with OP2, but there are many limitations to giving access in the manner in which I would like, so I'll need to convert this out of OP2.
As you can see, I'm building this with OP2, but there are many limitations to giving access in the manner in which I would like, so I'll need to convert this out of OP2.