Restrict Content Pro
rcp_can_member_renew()
Coming soon: Restrict Content Pro is becoming Kadence Memberships. You may see both names used while we update the product, documentation, and customer experience.
Note: This content is provided as a resource within our developer documentation. Because custom code requires highly specific implementation, we encourage you to work with a qualified developer if you need guidance. You can find our recommended consultants here: https://codeable.io/developers/restrict-content-pro
Returns whether the user can renew their membership through RCP’s renewal flow.
Deprecated in 3.0. Prefer RCP_Membership::can_renew() on the specific membership. This wrapper loads the customer’s single membership via rcp_get_customer_single_membership() (best fit when multiple memberships are disabled).
Renewal is typically blocked for active auto-renewing subscriptions, lifetime (none expiration) active memberships, free memberships, completed payment plans, and inactive membership levels (unless rcp_can_renew_deactivated_membership_levels allows it). Filter: rcp_membership_can_renew.
Parameters
$user_id (int) – User ID. Default: 0 (current logged-in user).
Return values
(bool) – true if renewal is allowed; false if not or if there is no customer/membership.
Examples
if ( rcp_can_member_renew() ) {
// Show renew button or link to registration renewal.
}
$membership = rcp_get_membership( $membership_id );
if ( $membership && $membership->can_renew() ) {
// Check a specific membership record.
}