Restrict Content Pro
rcp_is_paid_content()
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 a post is marked paid only (members must have a paid membership to access, not a free level). Checks post-type-wide paid rules first, then the post’s _is_paid meta from the restriction metabox.
This does not tell you whether the post is restricted at all, or whether the current user can view it. Use rcp_is_restricted_content() and rcp_user_can_access() for those checks.
Parameters
$post_id (int) – Post ID. If empty or not an integer, the current post from get_the_ID() is used.
Return values
(bool) – true if the post is paid-only; false if not.
Examples
if ( rcp_is_paid_content( get_the_ID() ) ) {
// Paid members only for this post.
}
if ( rcp_is_paid_content( $post_id ) ) {
// Require paid membership (or trialing paid level) for access logic.
}