Filter and return the levels for a user ID or the currently logged-in user.


/**
 * Retrieve the levels for a user.
 *
 * Filters the returned levels.
 *
 * @since 1.8.5.4
 *
 * @see pmpro_getMembershipLevelsForUser
 *
 * @param array $levels  Array of level objects.
 * @param int   $user_id The User ID or current user ID.
 *
 * @return array $levels Array of level objects.
 */
$levels = apply_filters( 'pmpro_get_membership_levels_for_user', $levels, $user_id );

Parameters

$levels
object
$user_id
int

Return Value

$levels


Source

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

View in Source Code