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 is part of the developer docs and is considered custom code.
Unfortunately, we cannot provide support for custom code at this time as we do not have the additional resources that would be necessary to provide support for custom code.Â
If you need assistance with this, please reach out to our list of consultants for further assistance:
https://codeable.io/developers/restrict-content-pro/
rcp_is_recurring($user_id = null)
This function will check whether the user ID supplied to the function has currently active recurring subscriptions.
Parameters:
$user_id – ID of the user to check (optional).
If no user ID is supplied, then the function will check the ID of the currently logged-in user.
Return values:
true if the user has a recurring subscription.
false if the user does not have a recurring subscription.
Example usage:
if(rcp_is_recurring(34)) {
// user ID 34 has an active and recurring subscription
} else {
// user ID 34 does not have a recurring subscription
}