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.
How the bypass works
The plugin’s mam_gd_staff_manager::apply_in_app_purchase($require_iap) runs:
- Reads the current user’s
mam_staff_user meta keys, which list the listings on which the user is staff. (The naming pattern ismam_staff_{listing_id}; presence of any such meta means the user is staff somewhere.) - If the user has any staff meta, returns
false(no IAP required). - Otherwise returns the upstream value unchanged.
The check does not currently inspect the listing’s gd-no-iap-for-author-staff toggle — the option is set in the admin UI but the runtime always returns false for any staff user. This is consistent with the intent (any staff member is exempted) but is worth knowing.
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
- A user with at least one entry in their
mam_staff_*user meta opens the app and is not asked to subscribe. - A user with a pending staff invite is not asked to subscribe on the launch where the Manage Invites form is shown.
- A user with neither sees the standard IAP gate (controlled by
mam-inapp-purchase-manager).
Things to watch for
- The toggle is informational at runtime. Disabling
gd-no-iap-for-author-staffdoes not currently re-enable IAP for staff. To prevent the bypass entirely, removemam_gd_staff_manager::apply_in_app_purchasefrom the filter chain. - The check is staff-only. Listing owners who are not also enrolled as staff/manager via the chat-manager invite system will not be exempted by this integration. In normal flows, owners are added to the listing_staff group automatically; this is more of a corner case for old data.
- Admins are not exempted by this integration. The IAP plugin typically already exempts admins on its own.
Steps to enable
- Install and activate
mam-inapp-purchase-manager. - Set
gd-no-iap-for-author-stafftoyesunder Settings. - Verify a test staff member (with
mam_staff_{listing_id}user meta set) 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 mam_staff_{listing_id} user meta naming changes, 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
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 |
