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/
This function is deprecated. Use rcp_user_has_expired_membership() instead.
rcp_is_expired($user_id = null)
This function will check whether the subscription of the user ID supplied to the function is expired.
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's subscription is expired.false
if the user's subscription is not expired.
Example usage:
if(rcp_is_expired(34)) { // user ID 34's subscription is expired } else { // user ID 34's subscription is active, not expired }