How to get membership level id f a particular user [closed]

You probably want pmpro_getMembershipLevelsForUser from functions.php:

/* pmpro_getMembershipLevelsForUser() returns the membership levels for a user
 *
 * If $user_id is omitted, the value will be retrieved from $current_user.
 * By default it only includes active memberships.
 *
 * Return values:
 *      Success returns an array of level objects.
 *      Failure returns false.
 */
function pmpro_getMembershipLevelsForUser($user_id = NULL, $include_inactive = false)
{

Or there’s pmpro_getMembershipLevelForUser if you only want the first level. Or if you actually want to test access then there’s pmpro_hasMembershipLevel too.

As far as I can see these are all stored in separate tables with date ranges and other restrictions so there’s no simple way to access them through normal WP user functions.

(And I expect there’s documentation about all of these on their website here http://www.paidmembershipspro.com/documentation/ but it looks like you’ll have to sign up.)