This hook is triggered during a very small edge case where membership checkout fails for users with an existing membership and we reinstate membership for a 3 day grace period.

apply_filters( 'pmpro_stripe_days_grace_when_canceling_existing_subscriptions_at_checkout', $days_grace, $memberships_users_row );

Some notes on this edge case:

  • For sites that aren’t using our Multiple Memberships Per User Add On: when someone checks out for a level, we cancel their old level.
  • There are very edge cases where checkout for the new level fails mid-process. When this happens, the plugin code tries to undo the prior cancellation by voiding what was done.
  • In some setups, the user may have to complete checkout for their old level again to reinstate membership. If you are using a restricted checkout flow (like our Approvals Add On), this code reinstates their old membership for a 3 day grace period so checkout or access to members-only content isn’t restricted.
  • TLDR: You’ll probably never see this grace period triggered or need to use this filter.


integer; The number of grace period days to give the member. Default is 3 days
object; The row data from the pmpro_memberships_users table including membership_id, user_id, and enddate



View in Source Code