Restrict Content Pro
rcp_get_subscription()
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 the name of the membership level for the user’s primary membership (not the membership record ID).
Deprecated in 3.0. Prefer rcp_get_customer_membership_level_names().
Filter: rcp_member_get_subscription_name.
Parameters
$user_id (int) – User ID. Default: 0 (current logged-in user when logged in).
Return values
(string) – Level name, or empty if there is no level.
Examples
$name = rcp_get_subscription( get_current_user_id() );
if ( $name ) {
echo esc_html( $name );
}
Related shortcode:Â subscription_name.