Home » Docs » Member Lookup Abilities

Member Lookup Abilities

These abilities answer questions about an individual user’s membership: whether they are a member, what subscriptions they hold, and whether they have an access pass. They are all read-only and require the manage_options capability (site administrator). See the Abilities API Overview for requirements and the full catalog.

Identifying the User

Every ability in this group identifies the user the same way — provide exactly one of:

ParameterTypeDescription
user_idintegerThe WordPress user ID
emailstringThe user’s email address. Provide exactly one of user_id or email — never both

If neither is provided the ability returns members_only_missing_user; if no matching user exists it returns members_only_user_not_found. Supplying both identifiers fails input validation, and a mismatched pair supplied directly to a callback returns members_only_conflicting_identifiers — the ability never silently prefers one identifier over the other, so an ID/email mix-up can never target the wrong account.

get-member-status

members-only/get-member-status returns a membership overview for a user — the quickest way to answer “is this person a member, and why?”

Returns:

  • user_id and email
  • is_member — whether the user counts as a member under the plugin’s rules
  • has_active_membership — whether they have an active paid membership
  • has_access_pass — whether they hold a currently active access pass
  • subscription_status — the aggregate Stripe subscription status
  • group_memberships — the groups the user belongs to (empty when the Group Memberships extension is not active)

list-user-memberships

members-only/list-user-memberships lists a user’s memberships (Stripe subscriptions) filtered by status. By default it returns only active memberships.

ParameterTypeRequiredDescription
user_id / emailinteger / stringOne requiredIdentifies the user
statusstringNoOne of active, canceled, incomplete, incomplete_expired, past_due, trialing, unpaid, or all. Defaults to active.

Returns: user_id, the status filter used, a count, a truncated flag, and a memberships array. Each membership includes the subscription ID, status, cancel_at_period_end, current period start/end timestamps, and plan details. Up to 100 subscriptions are returned per status; truncated is true when the user has more and the list is incomplete.

An unsupported status value returns members_only_invalid_status rather than silently returning an empty list.

list-member-subscriptions

members-only/list-member-subscriptions lists a user’s Stripe subscriptions regardless of status — including canceled and past-due ones — up to 100 subscriptions. Use this for a billing history view; use list-user-memberships when you want to filter by status.

Returns: user_id, a count, a truncated flag, and a subscriptions array in the same shape as list-user-memberships. When truncated is true the user has more subscriptions than the 100-subscription cap and the list is incomplete.

list-user-access-passes

members-only/list-user-access-passes returns the user’s access pass, if they have one.

Returns:

  • user_id
  • has_active_pass — whether the pass is currently active
  • access_pass — the pass with its start_date, end_date (Unix timestamps), and granted_by user ID, or null when the user has no pass

Note that a user has at most one access pass at a time; an expired pass is still returned (with has_active_pass set to false) until it is removed or replaced.