Restrict Content Pro
rcp_is_expired()
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
Deprecated since 3.0. Checks whether a user is expired via the legacy RCP_Member object. Prefer rcp_membership_is_expired() for a single membership ID, or rcp_user_has_expired_membership() to see whether the customer has any membership with status expired.
Parameters
$user_id (int) – User ID. Default: 0 (current logged-in user when $user_id is empty and the visitor is logged in).
Return values
(bool) – true if the legacy member check reports expired, otherwise false.
Examples
Check one membership:
if ( rcp_membership_is_expired( 456 ) ) {
// Membership #456 is expired.
}
Check whether the user has any expired membership record:
if ( rcp_user_has_expired_membership( $user_id ) ) {
// Customer has at least one expired membership.
}