Restrict Content Pro
rcp_get_restricted_post_types
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 every post type that has global restriction rules saved under Restrict Content → Settings (Restrict an Entire Post Type). Stored in the rcp_restricted_post_types option.
This is configuration data, not a per-user access check. To see whether a single post type is restricted, use rcp_is_restricted_post_type( $post_type ). To read rules for one post type, use rcp_get_post_type_restrictions( $post_type ). Per-post metabox rules are separate; see rcp_get_post_restrictions().
Parameters
None.
Return values
(array) – Keys are post type slugs; values are restriction setting arrays (membership levels, access level, paid-only flags, and similar). Empty array if none are configured.
Examples
$restricted = rcp_get_restricted_post_types();
if ( isset( $restricted['post'] ) ) {
// The "post" post type has global restrictions.
}
if ( rcp_is_restricted_post_type( 'page' ) ) {
$rules = rcp_get_post_type_restrictions( 'page' );
}
Related: Restricting an Entire Post Type.