Hook: mam_app_settings_get_tab_bar_settings

Purpose

Returns the tab-bar configuration for the active role. The phone-data pipeline reads this in phase_content before walking the tab slots and firing mam_main_skip_tab_bar_button / mam_main_add_tab_bar_item_{slug} per slot.


Signature

$tab_bar = apply_filters(
    'mam_app_settings_get_tab_bar_settings',
    $default,
    string $role
);
Parameter Type Description
$default mixed Fallback (typically empty array)
$role string Role slug

Returns: array — tab-bar configuration.


Returned shape

array(
    'buttons' => array(
        array(
            'id'          => 'home_button',
            'title'       => 'Home',
            'icon'        => 'black_home',
            'visible'     => 'on',
        ),
        array(
            'id'          => 'edit_listing',
            'title'       => 'Edit',
            'icon'        => 'black_edit',
            'visible'     => 'on',
            'use_off'     => 'yes',                // optional toggle-state variant
            'off_title'   => 'View',
            'off_icon'    => 'black_view',
        ),
        // ...
    ),
    'visible' => 'on',
)

The buttons array drives the tab-bar dispatch: only entries with visible === 'on' participate in the per-slug filter chain.


A separate filter returns the per-button definitions for the tab bar:

$buttons = apply_filters( 'mam_app_settings_get_tab_bar_buttons', $default, $role );

This is the menu of tab-bar buttons available for selection in the admin UI; mam_app_settings_get_tab_bar_settings is the per-role configured selection.


Gotchas

  • visible === 'on' is the gate. Without it, the entire per-slug filter chain (mam_main_skip_tab_bar_button, mam_main_add_tab_bar_item_{slug}, mam_tab_manager, mam_final_button_settings) is short-circuited.
  • 5-tab convention. iOS shows up to 5 tabs gracefully; Android handles more, but the UX gets cluttered.
  • Per-role. Tab-bar settings are stored per-role; the cascade resolves through the data manager.
  • Ordering matters. The array order is the display order.

  • Recipe: Configure the tab bar
  • Hook: mam_main_skip_tab_bar_button
  • Hook: mam_main_add_tab_baritem{slug}
  • Hook: mam_tab_manager

Metadata

Field Value
Article type Hook Reference
Plugin slug mam-main
Applies to plugin version 2.1.11+
Hook type filter
Audience PHP developer
Frozen contract yes
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!