What it does
When mam-inapp-purchase-manager is active, mam-geodirectory registers a callback on the mam_iap_require_iap filter (owned by mam-inapp-purchase-manager). The callback decides whether the IAP gate should apply to the current user.
The intent: a venue owner or staff member should not be asked to subscribe to view content on their own listing. Without this integration, an owner who happens to not have an IAP subscription would be locked out of their own data.
Activation
Two things must be true:
mam-inapp-purchase-manageris active and consultsmam_iap_require_iapto decide whether to gate the user.- Under Mobile App Manager → Geodirectory → Settings, the toggle Exclude author and staff from In App Purchases? (
gd-no-iap-for-author-staff) is set toyes.
Two different IAP touchpoints. This article is about exempting owners and staff from the IAP subscription gate. Separately, In-App Purchase can be the payment rail for Claim Listing subscriptions (the
GetPaid_MAM_IAPgateway marks the claim invoice paid after a store purchase). That’s a different feature — see Form and flow: Claim Listing and Recipe: Set up Claim Listing subscriptions.
How the bypass works
The plugin’s mam_gd_staff_manager::apply_in_app_purchase($use_iap) runs:
- Resolves the current user via
mam_user_id(). If no user is signed in, returns the upstream value unchanged. - Admins always bypass. If the user is an
administrator, returns'no'(IAP not required) — before the toggle or any listing lookup. - Respects the toggle. If
gd-no-iap-for-author-staffis not'yes', returns the upstream value unchanged (no bypass). - Owner check. Queries whether the user authors any GeoDirectory listing (a
get_postsbyauthoracross all GD post types exceptgd_event). If they own at least one, returns'no'. - Accepted-staff check. Applies the
mam_user_has_accepted_group_membershipfilter; if it returns true (the user has accepted staff/manager membership on a GD listing), returns'no'. - Otherwise returns the upstream value unchanged.
The function returns the string 'no' to bypass (not a boolean false), matching the mam_iap_require_iap value convention.
The mam_geodirectory_phone_data::inject_pending_invite_form() code also unsets inapp_is_required on the data array when a user has a pending invite — so users who are about to become staff are also exempted on app launch.
What the user experiences
- An administrator, a user who authors any GD listing, or a user with accepted staff/manager membership on a GD listing opens the app and is not asked to subscribe (owners/staff only when the toggle is on).
- A user with a pending staff invite is not asked to subscribe on the launch where the Manage Invites form is shown.
- A user who is none of the above sees the standard IAP gate (controlled by
mam-inapp-purchase-manager).
Things to watch for
- The toggle gates the bypass. Setting
gd-no-iap-for-author-staffto anything other thanyesdisables the owner/staff bypass (admins are still exempted first, before the toggle is consulted). - Owners are exempted by authorship. The owner check is a
get_postsquery byauthoracross all non-event GD post types, so a listing author is exempted even if they were never enrolled as staff via the chat-manager invite system. - Accepted staff/managers are exempted via a filter. Staff membership is resolved through the
mam_user_has_accepted_group_membershipfilter rather than by readingmam_staff_*user meta directly in this function. - Admins are always exempted by this integration. The administrator check runs first and returns
'no'before the toggle or any listing lookup.
Steps to enable
- Install and activate
mam-inapp-purchase-manager. - Set
gd-no-iap-for-author-stafftoyesunder Settings. - Verify a test listing author (or an accepted staff/manager on a GD listing) is not prompted to subscribe.
- Verify a test user with a pending invite is not prompted on the launch where the invite form appears.
Verification
This article was last verified against:
- Plugin:
mam-geodirectoryv2.1.5 - Plugin:
mam-inapp-purchase-manager - Source:
includes/mam_gd_staff_manager.php—apply_in_app_purchase() - Source:
includes/mam_geodirectory_phone_data.php—inject_pending_invite_form()
Re-verify whenever the gd-no-iap-for-author-staff toggle handling changes, the owner/authorship or mam_user_has_accepted_group_membership checks in apply_in_app_purchase() change, the IAP plugin’s mam_iap_require_iap filter contract changes, or inject_pending_invite_form() stops unsetting inapp_is_required.
Related articles
- Plugin: mam-geodirectory
- Recipe: Configure the GeoDirectory settings page
- Form: Manage staff invitation
- Form and flow: Claim Listing — In-App Purchase as a claim payment rail
- Recipe: Set up Claim Listing subscriptions
Metadata
| Field | Value |
|---|---|
| Article type | Plugin Overview |
| Plugin slug | mam-geodirectory |
| Applies to plugin version | 2.1.5+ |
| Category | Plugin Reference |
| Audience | WordPress admin |
| Last verified | 2026-05-01 |
