MemberPress: Delete Transaction and User Account When Sub-Account is Removed
add_action(‘mpca_remove_sub_account’, function($transaction_id) { $txn = new MeprTransaction($transaction_id); $user_id = $txn->user_id; // Get MeprUser object for the user $user = new MeprUser($user_id); // Get all subscriptions for the user $active_subs = $user->active_product_subscriptions(‘ids’, true); // Get active subscription IDs // Check if…Continue reading