You are here

function hook_menu_firstchild_item_alter in Menu Firstchild 2.x

Alter the menu item created by Firstchild.

Parameters

array $menu_item: Item to be altered.

array|null $child: Child menu item, themain item was created from.

1 function implements hook_menu_firstchild_item_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

menu_firstchild_test_menu_firstchild_item_alter in tests/modules/menu_firstchild_test/menu_firstchild_test.module
Implements hook_menu_firstchild_item_alter().
1 invocation of hook_menu_firstchild_item_alter()
MenuItemParser::parse in src/MenuItemParser.php
Parses a menu item and modifies it if menu_firstchild is enabled.

File

./menu_firstchild.api.php, line 16
Hooks related to the Menu Firstchild module.

Code

function hook_menu_firstchild_item_alter(array &$menu_item, $child) {
  $menu_item['attributes']
    ->addClass('custom-class');
}