You are here

function menu_item_extras_preprocess_menu in Menu Item Extras 8.2

Same name and namespace in other branches
  1. 8 menu_item_extras.module \menu_item_extras_preprocess_menu()

Implements hook_preprocess_menu().

File

./menu_item_extras.module, line 238
Manage fields for the menu items.

Code

function menu_item_extras_preprocess_menu(&$variables) {

  // We preprocess only menus that has additional fields.
  if (!empty($variables['menu_name']) && Utility::checkBundleHasExtraFieldsThanEntity('menu_link_content', $variables['menu_name'])) {
    $variables['items'] = \Drupal::service('menu_item_extras.menu_link_tree_handler')
      ->processMenuLinkTree($variables['items'], $variables['menu_name']);
  }
}