MemberPress current user subscription id

916 Views Asked by At

I'm trying to get the subscription ID(s) for the current user in MemberPress. Can't find any examples of this in the documentation.

3

There are 3 best solutions below

1
On
$user = get_current_user_id();
0
On

Something like this should work:

$user = new MeprUser( get_current_user_id());

$subscriptions = $user->active_product_subscriptions('ids');
0
On

$active_subscription_ids = MeprUtils::get_currentuserinfo()->active_product_subscriptions('ids');