Restrict Content Pro

rcp_get_subscription_id()

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 membership level ID for the user’s primary membership (object_id on the membership record).

Deprecated in 3.0. Prefer rcp_get_customer_membership_level_ids() when multiple memberships are enabled.

Uses RCP_Member and the customer’s single/primary membership. Filter (legacy): rcp_member_get_subscription_id.

Parameters

$user_id (int) – User ID. Default: 0 (current logged-in user when logged in).

Return values

(int|false) – Membership level ID, or false if none.

Examples

$level_id = rcp_get_subscription_id();

if ( 2 === (int) $level_id ) {
	// Primary membership is level #2.
}

$customer = rcp_get_customer_by_user_id( $user_id );
$level_ids = $customer ? rcp_get_customer_membership_level_ids( $customer->get_id() ) : array();

Last updated: October 30, 2026
Was this page helpful?
Thanks for the feedback!