Hooks: home-screen stack (mam_hss_*)

Summary

The mam_hss_* family of filters lets sibling plugins compose the home-screen stack — the ordered list of sections rendered on the app’s home screen (hero card, horizontal scroller, list, etc.). Use these to inject pinned-to-top items, post-nav-header banners, and end-of-stack CTAs.

hss stands for home screen stack.


Filters

Filter Position Purpose
mam_hss_stack_after_nav_header After nav header Inject content directly below the top nav
mam_hss_pin_to_top Top of stack Pinned items shown above scrollable content
mam_hss_single_listing Per-listing item Modify a single listing entry
mam_hss_stack_item Per-stack-item Modify a single section as it’s added
mam_hss_stack_after_bottom_tabbar Below bottom tab bar Floating content above the tab bar
mam_hss_stack_final End of stack Last-chance modifications
mam_hss_end_of_stack After the stack is built Append items to the end
mam_main_populate_hss_categories Categories Populate home-screen category list
mam_main_populate_hss_tags Tags Populate home-screen tag list
mam_main_final_home_cats Categories final Last-chance for home-screen categories
mam_main_add_to_home_category_list Categories add Append to the home-cats array

Example: inject a pinned banner

add_filter( 'mam_hss_pin_to_top', function ( array $items ): array {

    $banner = $this->get_active_banner();
    if ( ! $banner ) return $items;

    $items[] = array(
        'type'  => 'banner',
        'image' => $banner['image_url'],
        'link'  => $banner['target_url'],
    );

    return $items;
} );

Example: append an end-of-stack CTA

add_filter( 'mam_hss_end_of_stack', function ( array $stack ): array {

    $stack[] = array(
        'type'  => 'cta',
        'title' => 'Become a member',
        'body'  => 'Members get exclusive deals',
        'cta'   => 'Join now',
        'link'  => 'btn_membership_signup',
    );

    return $stack;
} );

Relationship to home_cats

The home_cats JSON section is built by MAM_Main_Manager::manage_phone_data at priority 1000 in mam_get_phone_data_before_send. The mam_hss_* filters run during home-screen-stack assembly which is part of that build. Subscribers to mam_main_populate_hss_categories / mam_main_add_to_home_category_list participate in home_cats construction; subscribers to mam_main_final_home_cats get last-pass overrides.


Gotchas

  • Naming inconsistency — some filters use hss (home screen stack) and some use home or home_cats. They participate in the same overall build but at different points.
  • Position semantics matter. mam_hss_pin_to_top pins above scrollable content; mam_hss_stack_after_nav_header appears just below the nav header but is part of the scrollable stack. The visual difference is significant.
  • mam_hss_single_listing modifies individual listing entries — use this to enrich per-listing display, not to filter the listings array (use mam_geodirectory_final_listings or similar for that).
  • Hot path. All of these fire during phone-data build.

  • Phone data pipeline phases
  • Hook: mam_get_phone_data_before_send
  • Mobile JSON shape

Metadata

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