rcp_get_subscription_id()

rcp_get_subscription_id( $user_id )

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
}