Last active
December 18, 2015 17:19
-
-
Save supercleanse/5818063 to your computer and use it in GitHub Desktop.
Lifetime access after limit_cycles reached
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 | |
add_action( 'mepr-limit-payment-cycles-reached', 'cool_limit_payment_cycles_lifetime' ); | |
function cool_limit_payment_cycles_lifetime( $mepr_subscription = null ) { | |
if( !is_a( $mepr_subscription, 'MeprSubscription' ) | |
return false; | |
$txn = $mepr_subscription->latest_txn(); | |
$txn->expires_at = 0; // Zero for lifetime expiration | |
$txn->store(); | |
} |
Great idea ... just updated.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I added a little sanity check at the beginning