Duplicate Snippet
Embed Snippet on Your Site
MemberPress: Expire Subscription Immediately After Subscription Is Canceled
By default, canceling subscriptions prevents future charges, but it does not end existing subscriptions, which allow members access until the expiry date. Applying this code snippet will expire a member’s subscription when canceled by setting the transaction expiration date to the past. This will immediately prevent members from accessing protected content.
You can adjust the past date, which will be set as a transaction expiry date for all canceled transactions, by editing the date on this line:
$wpdb->update( $wpdb->prefix.'mepr_transactions', array( "expires_at" => "2024-01-01
Code Preview
php
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Comments