Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dwanjuki/c06fd665b1c27c8a840b0503fd534d7e to your computer and use it in GitHub Desktop.
Save dwanjuki/c06fd665b1c27c8a840b0503fd534d7e to your computer and use it in GitHub Desktop.
Unlock PMPro Series content at 5:00AM each day
<?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