MemberPress: Expire Subscription Immediately After Subscription Is Canceled
function mepr_capture_stopped_sub( $event ) { global $wpdb; $subscription = $event->get_data(); $wpdb->update( $wpdb->prefix.’mepr_transactions’, array( “expires_at” => “2024-01-01 23:59:59” ), array( “subscription_id” => $subscription->id, “status” => “complete” ) ); } add_action( ‘mepr-event-subscription-stopped’, ‘mepr_capture_stopped_sub’ );Continue reading