Skip to content

Commit

Permalink
Merge branch 'master' of github.com:strangerstudios/pmpro-subscriptio…
Browse files Browse the repository at this point in the history
…n-delays
  • Loading branch information
ideadude committed Jul 29, 2019
2 parents 7417784 + 9c20de3 commit 82055d3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pmpro-subscription-delays.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@ function pmprosd_pmpro_profile_start_date( $start_date, $order ) {
} else {
$start_date = date( 'Y-m-d', strtotime( '+ ' . intval( $subscription_delay ) . ' Days', current_time( 'timestamp' ) ) ) . 'T0:0:0';
}

$today = date( 'Y-m-d\T0:0:0', current_time( 'timestamp' ) );

// Stripe does strange things if the profile start is before the current date!
if ( $start_date < $today ) {
$start_date = $today;
}

$start_date = apply_filters( 'pmprosd_modify_start_date', $start_date, $order, $subscription_delay );
return $start_date;
Expand Down

0 comments on commit 82055d3

Please sign in to comment.