Return the first active membership for a user.


/**
 * Retrieves the first active membership for a user.
 *
 * @since 1.8.5.4
 *
 * @see pmpro_getMembershipLevelForUser
 *
 * @param object $level   Level object.
 * @param int    $user_id The User ID.
 *
 * @return object $level Level object.
 */
apply_filters( 'pmpro_get_membership_level_for_user', $all_membership_levels[ $user_id ], $user_id );

Parameters

$level
object
$user_id
int

Return Value

$level


Source

File: https://github.com/strangerstudios/paid-memberships-pro/blob/master/includes/functions.php

View in Source Code