Forked from dparker1005/my_pmpros_customize_series_delay.php
Last active
October 5, 2023 08:08
-
-
Save dwanjuki/c06fd665b1c27c8a840b0503fd534d7e to your computer and use it in GitHub Desktop.
Unlock PMPro Series content at 5:00AM each day
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
<?php | |
// Copy from below here... | |
/** | |
* Changes startdates that are retrieved for members. Useful for implementing custom | |
* content drip schedules when using the PMPro Series Add On. | |
* | |
* @param string $startdate in a timestamp format. | |
* @param int $user_id to get startdate for. | |
* @param int $level_id to get startdate for ('0' if not specified) | |
* @return string | |
*/ | |
function my_pmpros_customize_series_delay( $startdate, $user_id, $level_id ) { | |
/* | |
* To have posts unlock at 05:00 each morning... | |
*/ | |
$startdate = strtotime( 'today 5:00', $startdate ); | |
return strval( $startdate ); | |
} | |
add_filter( 'pmpro_member_startdate', 'my_pmpros_customize_series_delay', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment