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 );


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



View in Source Code