Primary responsibility
The Logout button. Renders only for authenticated users. Tapping it clears the app’s session state and fires the suite-wide logout actions so subscribers can clean up per-session caches.
Settings
None. Like the Login button, the Logout content class is a thin shell — get_content_type_form() returns “No settings required” and get_data_for_app() passes the category through unchanged. There are no per-button Logout settings to configure.
Hooks involved
| Hook | Type | Role |
|---|---|---|
mam_update_current_user |
Action | Fired after current-user state is reset (the logout handler resets the request context, then fires this) |
Note:
mam_logoutis the name of the AJAX endpoint the app calls to log out (registered inincludes/app-endpoints/mam-main-endpoints.php), not an action hook. The logout handler (mam_login_manager::do_logout) revokes the session token, deletes themam_app_tokenusermeta, resetsMAM_Current_Request, and firesmam_update_current_user.
Gotchas
- Class name is frozen.
local_app_logout_buttonappears in customer button arrays. - Renders only when authenticated. The phone-data pipeline omits the Logout button for unauthenticated users; pair it with a Login button on the same screen so anonymous viewers see Login and authenticated users see Logout.
- Logout doesn’t revoke push tokens. The user’s APNs/FCM token in
usermetasurvives logout — that’s intentional (the device is still registered with this user). To revoke a token, use the user-roles AJAX endpoints from the device.
Related articles
- Content classes overview
- Content class: Login button
- Hook: mam_user_logged_in
Metadata
| Field | Value |
|---|---|
| Article type | Screen Reference |
| Plugin slug | mam-main |
| Applies to plugin version | 2.1.11+ |
| Category | App Settings Reference |
| Audience | WordPress admin / PHP developer |
| Class name | local_app_logout_button (frozen) |
| Source file | includes/content-classes/local-app-logout-class.php |
| Last verified | 2026-05-02 |
