rcp_get_subscription()

rcp_get_subscription( $user_id )

This function can be used for retrieving the name of the subscription the current 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
}