Content class: Logout button

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

Limited — Logout buttons rarely need configuration. Typical fields:

Setting Type Environment Purpose
confirm_logout yes-no global If on, app shows a confirmation dialog
post_logout_redirect text per-button Button to navigate to after logout (often the Login button)
style_* various per-button Colors, icon

Hooks involved

Hook Type Role
mam_logout Action Fired when the logout flow begins
mam_update_current_user Action Fired after current-user state is reset

Gotchas

  • Class name is frozen. local_app_logout_button appears 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 usermeta survives 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.

  • 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
Contents

    Need Support?

    Can’t find the answer you’re looking for? Don’t worry we’re here to help!