rcp_can_member_cancel()

Determines whether or not a member is able to cancel their subscription. In order to return true, the user must meet all these criteria:

  • Has a recurring subscription.
  • Is currently an active member (has the status "active").
  • They've not already cancelled their subscription.
  • Their payment profile ID has been filled out.

Parameters:

  • $user_id - ID of the user to check. If omitted, the currently logged in user is used.

Return values:

  • true if the given user meets all the criteria and can cancel their subscription.
  • false if they are not able to cancel their subscription.