Filter to modify what level ID (or array of IDs if using the Multiple Memberships Per User Add On) are to be cancelled when a member purchases a new membership.

apply_filters( 'pmpro_stripe_levels_to_cancel_before_checkout', array( $membership_level->id ), $current_user );

Parameters

$levels_to_cancel
array; An array of level IDs to cancel when a user purchases a new membership. Defaults to their current active level.
$current_user
object; The current logged in user’s WP_User object.

Source

File: https://github.com/strangerstudios/paid-memberships-pro/blob/master/classes/gateways/class.pmprogateway_stripe.php

View in Source Code