Note: This is part of the developer docs and is considered custom code.
Unfortunately, we cannot provide support for custom code at this time as we do not have the additional resources that would be necessary to provide support for custom code.
If you need assistance with this, please reach out to our list of consultants for further assistance:
https://codeable.io/developers/restrict-content-pro/
rcp_get_subscription_id( $user_id )
This function was deprecated in RCP version 3.0. Use rcp_get_customer_membership_level_ids() instead.
This function can be used for retrieving the ID number of the subscription the current user is subscribed to. It will return an integer, such as 2, 3, or 4.
Parameters:
- $user_id - ID of the user to check. You can pass in get_current_user_id() to use the ID of the currently logged-in user.
Return values:
- (int) ID of the user's subscription level, such as 2, 3, or 4.
Example usage:
$subscription_id = rcp_get_subscription_id( get_current_user_id() ); if( $subscription_id == 2 ) { // do something here }