Goal
Wire up the built-in “support chat” channel: pick the WordPress administrators who can answer it, decide the display name and avatar end users see when they open it, and choose between the one-on-one and group-chat presentation modes. After this recipe, end users will have a chat thread with your admin team accessible from a dedicated nav button.
Prerequisites
- Chat enabled per Recipe: Enable chat
- WP Admin access with
activate_pluginscapability - A list of which administrators should answer support chat — typically a subset of the site’s WP administrators, not all of them
How admin chat works
mam-chat-manager ships two pieces of the admin support chat:
- A Chat Settings admin page (Mobile App Manager → Chat Settings) where you choose the admin display name, avatar, and the WP administrators who participate in the support thread.
- A content class —
mam_admin_chat— that the app can place in any nav slot. When the user taps it, the app opens (or creates) a thread tied to your admin group.
Behind the scenes, the plugin maintains a single mam-chat-group CPT (the “admin chat group”) whose membership is the list of administrators you pick. The post ID of that group is stored in the mam_chat_admin_chat_group option and is used to resolve the support thread for each end user.
The admin chat block has two presentation modes:
- One on One Chat with Admin Group — every end user gets their own private thread with the admin group. End users see “Admin” (or your configured name); admins see threads from individual end users.
- Group Chat with Admin — all end users share a single thread with the admins. Closer to a town-hall channel than a support inbox; usually only appropriate for very small communities.
Steps
1. Pick the admin participants
Go to Mobile App Manager → Chat Settings.
The page lists every WordPress user with the administrator role. Tick the boxes for the admins who should be reachable through support chat. Only ticked admins will receive push notifications for new support messages and only their replies will appear under the configured display name and avatar.
When you save:
- If the admin chat group doesn’t exist yet, the plugin creates it (
mam-chat-groupCPT) and stores its post ID in themam_chat_admin_chat_groupoption. - The group membership is overwritten with your selection. Any administrator who was previously a member but is now unchecked is removed; any new tick is added.
- The membership change fires
mam_reset_group_members_for_post_id, which causes the participant index on every existing support thread to refresh. Mid-conversation admin removals are reflected on the next phone-data request.
2. Set the display name end users see
In the same admin page, fill in Chatting with Name for Admins. This is what end users see in the thread header and in their thread list.
A few patterns:
- For a marketplace app: the company name (e.g.
Acme Marketplace) - For a single-tenant app: a generic helper name (e.g.
Customer Support) - For a brand voice with personality: a first name (e.g.
Riley from Acme)
Save. The change is reflected immediately the next time an end user opens the support thread.
3. Pick the admin avatar
In the Avatar Image for Admin Chat section, upload an image (or pick one from the media library). Most apps use a square logo at 256×256 or 512×512.
The avatar URL is stored in mam_chat_admin_avatar. If the value is empty, the plugin falls back to the bundled includes/avatar.png placeholder.
4. Place an admin-chat nav button in the app
The Chat Settings page does not place the admin-chat surface in the app — it only configures it. Open the role’s home-screen, left-menu, or other nav configuration in Mobile App Manager → App Settings and add a button whose content type is Admin Chat. The button’s content-source dropdown will let you pick:
- One on One Chat with Admin Group (default — what most apps want)
- Group Chat with Admin
Save the role.
5. Smoke-test
Sign in to the app as a non-admin user and tap the admin-chat button. Expect:
- A thread opens (or, if it’s the user’s first time, a fresh thread is created on the spot)
- The header shows the display name and avatar you configured in steps 2 and 3
- Sending a message dispatches a push notification to every ticked admin
Sign in as one of the ticked admins. Expect:
- The thread appears in the standard chat thread list
- Replies are attributed to the individual admin (their personal display name and avatar)
Variations
Pin support chat to a specific context post
By default the admin chat thread is tied to the global admin group with a post_id of 0. If your app has a per-listing or per-product admin (e.g. a marketplace where each storefront has its own support thread), use Hook: mam_admin_chat_main_post_id (referenced by the mam_admin_chat content class) to override the context post ID. Each unique post ID produces a separate thread.
Override the admin group at runtime
The same content class also calls mam_admin_chat_groups and mam_admin_chat_main_user. These let an integrator plugin replace the group list (e.g. route a user to a tier-specific support group) or override which user(s) are on the end-user side of the conversation. The defaults pull from the Chat Settings page, so you only need these filters when the admin team membership depends on something the role-settings UI can’t express.
Replace the display name with the responding admin’s name
By default, every reply in the support thread shows up to the end user as “Admin” (or whatever you set in step 2), regardless of which admin sent it. Some apps prefer to attribute each message to the specific admin who wrote it. Use Hook: mam_chat_set_chat_user_name to switch on whether the recipient is the end user or a fellow admin and return the appropriate name.
Verification
This article was last verified against:
- Plugin:
mam-chat-managerv2.0.0 - Source:
includes/mam_chat_manager_admin_settings.php(chat_settings_page()) - Source:
content-classes/content-class-admin-chat.php - WP options:
mam_chat_admin_chat_group,mam_chat_admin_name,mam_chat_admin_avatar
Re-verify whenever the mam-chat-admin[] POST handler in chat_settings_page() changes, the option keys above are renamed, the mam_admin_chat content class registration is moved, or the mam_admin_chat_groups / mam_admin_chat_main_post_id / mam_admin_chat_main_user filter signatures change.
Common gotchas
- Saving the page with zero admins ticked produces a thread with no recipients. End users can still send messages to the thread, but no admin will get a push notification because there’s no one to notify. Tick at least one admin.
- Removing the only admin who ever replied does not delete their past replies. The messages stay on the thread (attributed to the now-removed admin), and the thread continues to exist. Use the Chat History page to spot-check.
- The “Chatting with Name for Admins” field is global, not per role. Different roles can have different chat colors, but every role sees the same admin display name. To vary it per role, override at runtime via Hook: mam_chat_set_chat_user_name.
- The Chat Settings form is nonce-protected; the older
?reset_chat=1admin URL is gated bymanage_optionsplus a nonce. Do not bookmark the reset URL — it deletes every thread on the site.
Related articles
- Plugin: mam-chat-manager
- Recipe: Enable chat
- Recipe: Style chat bubbles and behavior
- Hook: mam_chat_set_chat_user_name
- Hook: mam_chat_manager_get_user_avatar
- Hook: mam_chat_add_to_chat_thread
Metadata
| Field | Value |
|---|---|
| Article type | Recipe (Admin) |
| Plugin slug | mam-chat-manager |
| Applies to plugin version | 2.0.0+ |
| Category | Building Your App |
| Audience | WordPress admin |
| Estimated time | 10 minutes |
| Prerequisites article | Recipe: Enable chat |
| Last verified | 2026-05-01 |
