rcp_get_subscription()

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( $user_id )

This function was deprecated in RCP version 3.0. Use rcp_get_customer_membership_level_names() instead.

This function can be used for retrieving the name of the subscription the specified user is subscribed to. It will return a string, such as Gold, Silver, or Platinum.

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:

  • (string) The name of the user's subscription, such as Gold, Silver, or Platinum.

Example usage:

$subscription = rcp_get_subscription( get_current_user_id() );
if( $subscription == 'Gold' ) {
	// do something here
}
		
Powered by Zendesk