Hook: mam_main_content_class_settings

Purpose

Extension point for the Settings Menu content class. Lets sibling plugins append entries to the user’s settings drawer — for example “Manage subscriptions”, “Linked accounts”, “Diagnostics”.


Signature

$entries = apply_filters( 'mam_main_content_class_settings', array $entries );
Parameter Type Description
$entries array Array of menu-entry definitions

Returns: array — augmented entries.


Entry shape

array(
    'title'  => 'Manage subscriptions',
    'icon'   => 'black_subscription',
    'action' => 'open_form',
    'source' => '<form_index_or_button_id>',
    'values' => array( ... ),    // optional pre-fill data for the target form
)

The action token follows the same conventions as tab-bar buttons — common values are open_form, open_form_array, share_listing, phone_call, plus app-side custom actions.


Example: append a “Manage subscriptions” entry

add_filter( 'mam_main_content_class_settings',
    function ( array $entries ): array {

        $form_index = apply_filters( 'mam_gf_get_form_from_cache', 0,
            get_option( 'my_plugin_subscriptions_form_id' ) );

        if ( $form_index <= 0 ) {
            return $entries;
        }

        $entries[] = array(
            'title'  => 'Manage subscriptions',
            'icon'   => 'black_subscription',
            'action' => 'open_form',
            'source' => $form_index,
        );

        return $entries;
    }
);

Gating per role

The settings drawer is shown to authenticated users; you typically gate per role inside your subscriber:

add_filter( 'mam_main_content_class_settings', function ( array $entries ): array {

    if ( ! current_user_can( 'subscriber' ) ) {
        return $entries;
    }

    $entries[] = array( ... );
    return $entries;
} );

Gotchas

  • The Settings Menu content class controls inclusion. Make sure the Settings Menu button is configured for the role you’re targeting; otherwise your entry is appended to a drawer that’s never shown.
  • source typing varies by action. For open_form it’s the form index (int as string). For open_form_array it’s an array of form definitions. See Hook: mam_main_add_tab_baritem{slug} for the action conventions.
  • Order matters. Entries are rendered in the order they appear in the array.
  • No de-duplication. Two subscribers appending identical entries produce duplicates.

  • Content class: Settings Menu
  • Hook: mam_main_add_tab_baritem{slug}

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!