# Adding an Item to the CRM Menu

How to add custom items to the CRM sidebar navigation using the `la24_dashboard_menu_items` action hook.


Overview

The `la24_dashboard_menu_items` action fires during the CRM panel navigation build phase. Attach to it to add section headers and clickable links to the left-hand sidebar of the CRM dashboard.

Hook Signature

php
do_action( 'la24_dashboard_menu_items' );
**Type:** Action **When fired:** During CRM panel navigation build **Returns:** nothing — call `LA24()->Menu()::multi_add()` directly inside the callback

Basic Usage

php
add_action( 'la24_dashboard_menu_items', function () {

    $menus = array();

    // Top-level toggle (parent item / section header)
    $menus['my_crm_section'] = array(
        'name'      => __( 'My CRM Module', 'my-crm-ext' ),
        'icon'      => 'fa fa-briefcase',
        'parent'    => '',        // empty = top-level
        'priority'  => 80,        // lower = higher in the menu
        'is_toggle' => true,      // true = collapsible section header
    );

    // Child menu item
    $menus['MyCrmPage'] = array(
        'name'      => __( 'CRM Dashboard', 'my-crm-ext' ),
        'icon'      => 'fa fa-tachometer',
        'parent'    => 'my_crm_section',  // parent key
        'priority'  => 10,
        'is_toggle' => false,
    );

    // Another child
    $menus['MyCrmReports'] = array(
        'name'      => __( 'Reports', 'my-crm-ext' ),
        'icon'      => 'fa fa-bar-chart',
        'parent'    => 'my_crm_section',
        'priority'  => 20,
        'is_toggle' => false,
    );

    LA24()->Menu()::multi_add( $menus );
} );

FieldTypeDescription
`name`stringDisplay label (translatable via `__()`)
`icon`stringFontAwesome class, e.g. `fa fa-users`
`parent`stringParent key, or `''` for top-level
`priority`intSort order (ascending — lower number appears first)
`is_toggle`bool`true` = collapsible section header; `false` = clickable link

Hierarchical Menus

Menu items support one level of nesting:
  • Set `parent` to `''` on the section header (`is_toggle: true`)
  • Set `parent` to the section header key on child items
A child item with a key that matches a registered `la24_endpoints` endpoint will automatically link to that endpoint's URL.

Priority and Ordering

  • Lower `priority` values appear higher in the sidebar
  • Core LA24Core menu items use priorities from `10` to `50`
  • Use values of `60` or higher for custom extensions to avoid conflicts
php
// This section appears below all core items
$menus['my_section'] = array(
    'priority'  => 90,
    'is_toggle' => true,
    ...
);

Manage Cookies

Choose which cookies this website may use. You can change your choice at any time.

Always on

Required for the website to work, for example to keep you signed in, keep your shopping cart and remember this cookie choice. They cannot be switched off.

Analytics, social media connections, live chat and personalized advertising based on your online activity. These are only used if you allow them.