Restrict Content Pro
rcp_get_term_restrictions()
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 restriction settings saved on a taxonomy term (category, tag, or other RCP-enabled taxonomy). Reads term meta rcp_restricted_meta, with a fallback to the legacy option rcp_category_meta_{term_id}.
This returns configuration only—not whether a user satisfies the rules. Use rcp_user_can_access_term() for user access.
Parameters
$term_id (int) – Term ID.
Return values
(array) – Restriction data for the term. Common keys (when set):
paid_only – Paid membership required.access_level – Minimum access level (integer). Omitted when stored asÂnone.subscriptions – Array of membership level IDs allowed for the term.
Returns an empty array when the term has no restrictions.
Examples
$restrictions = rcp_get_term_restrictions( $term_id );
if ( ! empty( $restrictions['paid_only'] ) ) {
// Term is restricted to paid members.
}
Related:Â Restricting Content by Category