1.20.x menu.module menu_load_all()

Load all custom menu data.

Return value

Array of custom menu data.:

File

modules/menu/menu.module, line 224
Allows administrators to customize the site's menus.

Code

function menu_load_all() {
  $custom_menus = &backdrop_static(__FUNCTION__);
  if (!isset($custom_menus)) {
    if ($cached = cache('menu')->get('menu_configs')) {
      $custom_menus = $cached->data;
    }
    else {
      $config_names = config_get_names_with_prefix('menu.menu.');
      foreach ($config_names as $config_name) {
        $menu = config_get($config_name);
        $custom_menus[$menu['menu_name']] = $menu;
      }
      cache('menu')->set('menu_configs', $custom_menus);
    }
  }
  return $custom_menus;
}