diff --git a/admin_menu.api.php b/admin_menu.api.php
index 337bf34..6c4a5bd 100644
--- a/admin_menu.api.php
+++ b/admin_menu.api.php
@@ -92,7 +92,7 @@ function hook_admin_menu_output_build(&$content) {
   if (isset($content['icon'])) {
     $content['icon']['myitem']['cron'] = array(
       '#title' => t('Run cron'),
-      '#access' => user_access('administer site configuration'),
+      '#access' => \Drupal::currentUser()->hasPermission('administer site configuration'),
       '#href' => 'admin/reports/status/run-cron',
     );
   }
diff --git a/admin_menu.inc b/admin_menu.inc
index faebfb3..5554210 100644
--- a/admin_menu.inc
+++ b/admin_menu.inc
@@ -1,5 +1,6 @@
 <?php
 
+use Drupal\Core\Render\Element;
 /**
  * @file
  * Menu builder functions for Administration menu.
@@ -15,9 +16,9 @@ function admin_menu_tree($menu_name) {
   // Get placeholder expansion arguments from hook_admin_menu_map()
   // implementations.
   module_load_include('inc', 'admin_menu', 'admin_menu.map');
-  $expand_map = module_invoke_all('admin_menu_map');
+  $expand_map = \Drupal::moduleHandler()->invokeAll('admin_menu_map');
   // Allow modules to alter the expansion map.
-  drupal_alter('admin_menu_map', $expand_map);
+  \Drupal::moduleHandler()->alter('admin_menu_map', $expand_map);
 
   $new_map = array();
   foreach ($expand_map as $path => $data) {
@@ -407,7 +408,7 @@ function admin_menu_links_menu($tree) {
       // Automatically hide empty categories.
       // Check for empty children first for performance. Only when non-empty
       // (typically 'admin/config'), check whether children are accessible.
-      if (empty($children) || !element_get_visible_children($children)) {
+      if (empty($children) || !Element::getVisibleChildren($children)) {
         $links[$data['link']['href']]['#access'] = FALSE;
       }
     }
@@ -440,7 +441,7 @@ function admin_menu_links_icon() {
   $links['icon']['cron'] = array(
     '#title' => t('Run cron'),
     '#weight' => 50,
-    '#access' => user_access('administer site configuration'),
+    '#access' => \Drupal::currentUser()->hasPermission('administer site configuration'),
     '#href' => 'admin/reports/status/run-cron',
     '#options' => array(
       'query' => $destination,
@@ -451,7 +452,7 @@ function admin_menu_links_icon() {
     '#title' => t('Run updates'),
     '#weight' => 50,
     // @see update_access_allowed()
-    '#access' => $GLOBALS['user']->uid == 1 || !empty($GLOBALS['update_free_access']) || user_access('administer software updates'),
+    '#access' => $GLOBALS['user']->uid == 1 || !empty($GLOBALS['update_free_access']) || \Drupal::currentUser()->hasPermission('administer software updates'),
     '#href' => base_path() . 'update.php',
     '#options' => array(
       'external' => TRUE,
@@ -461,12 +462,12 @@ function admin_menu_links_icon() {
   $links['icon']['drupal.org'] = array(
     '#title' => 'Drupal.org',
     '#weight' => 100,
-    '#access' => user_access('display drupal links'),
+    '#access' => \Drupal::currentUser()->hasPermission('display drupal links'),
     '#href' => 'http://drupal.org',
   );
   // Add links to project issue queues.
-  foreach (module_list() as $module) {
-    $info = drupal_parse_info_file(drupal_get_path('module', $module) . '/' . $module . '.info.yml');
+  foreach (\Drupal::moduleHandler()->getModuleList() as $module_name => $module) {
+    $info =  drupal_parse_info_file($module->getPath() . '/' . $module_name . '.info.yml');
     if (!isset($info['project']) || isset($links['icon']['drupal.org'][$info['project']])) {
       continue;
     }
@@ -483,13 +484,13 @@ function admin_menu_links_icon() {
   $links['icon']['flush-cache'] = array(
     '#title' => t('Flush all caches'),
     '#weight' => 20,
-    '#access' => user_access('flush caches'),
+    '#access' => \Drupal::currentUser()->hasPermission('flush caches'),
     '#href' => 'admin_menu/flush-cache',
     '#options' => array(
       'query' => $destination + array('token' => drupal_get_token('admin_menu/flush-cache')),
     ),
   );
-  $caches = module_invoke_all('admin_menu_cache_info');
+  $caches = \Drupal::moduleHandler()->invokeAll('admin_menu_cache_info');
   foreach ($caches as $name => $cache) {
     $links['icon']['flush-cache'][$name] = array(
       '#title' => $cache['title'],
@@ -501,10 +502,10 @@ function admin_menu_links_icon() {
   }
 
   // Add Devel module menu links.
-  if (module_exists('devel')) {
+  if (\Drupal::moduleHandler()->moduleExists('devel')) {
     $devel_tree = menu_build_tree('devel');
     $devel_links = admin_menu_links_menu($devel_tree);
-    if (element_get_visible_children($devel_links)) {
+    if (Element::getVisibleChildren($devel_links)) {
       $links['icon']['devel'] = array(
         '#title' => t('Development'),
         '#weight' => 30,
@@ -527,7 +528,7 @@ function admin_menu_links_account() {
     '#weight' => 100,
   );
   $links['account'] = array(
-    '#title' => user_format_name($GLOBALS['user']),
+    '#title' => \Drupal::currentUser()->getUsername(),
     '#weight' => -99,
     '#attributes' => array('class' => array('admin-menu-action', 'admin-menu-account')),
     '#href' => 'user/' . $GLOBALS['user']->uid,
@@ -539,8 +540,8 @@ function admin_menu_links_account() {
     '#href' => 'user/logout',
   );
   // Add Devel module switch user links.
-  if (!module_exists('masquerade')) {
-    $switch_links = module_invoke('devel', 'switch_user_list');
+  if (!\Drupal::moduleHandler()->moduleExists('masquerade')) {
+    $switch_links = \Drupal::moduleHandler()->invoke('devel', 'switch_user_list');
     if (!empty($switch_links) && count($switch_links) > 1) {
       foreach ($switch_links as $uid => $link) {
         $links['account'][$uid] = array(
@@ -575,7 +576,7 @@ function admin_menu_links_users() {
     '#description' => t('Current anonymous / authenticated users'),
     '#weight' => -90,
     '#attributes' => array('class' => array('admin-menu-action', 'admin-menu-users')),
-    '#href' => (user_access('administer users') ? 'admin/people/people' : 'user'),
+    '#href' => (\Drupal::currentUser()->hasPermission('administer users') ? 'admin/people/people' : 'user'),
   );
   return $links;
 }
@@ -769,7 +770,7 @@ function admin_menu_flush_cache($name = NULL) {
   }
 
   if (isset($name)) {
-    $caches = module_invoke_all('admin_menu_cache_info');
+    $caches = \Drupal::moduleHandler()->invokeAll('admin_menu_cache_info');
     if (!isset($caches[$name])) {
       throw new Symfony\Component\HttpKernel\Exception\NotFoundHttpException();
     }
@@ -853,14 +854,14 @@ function _admin_menu_flush_cache($name = NULL) {
       break;
 
     case 'bootstrap':
-      cache('bootstrap')->deleteAll();
-      cache('config')->deleteAll();
+      \Drupal::cache('bootstrap')->deleteAll();
+      \Drupal::cache('config')->deleteAll();
       break;
 
     case 'cache':
       // @see drupal_flush_all_caches()
-      foreach (module_invoke_all('cache_flush') as $bin) {
-        cache($bin)->deleteAll();
+      foreach (\Drupal::moduleHandler()->invokeAll('cache_flush') as $bin) {
+        \Drupal::cache($bin)->deleteAll();
       }
       break;
 
@@ -868,16 +869,16 @@ function _admin_menu_flush_cache($name = NULL) {
       // Change query-strings on css/js files to enforce reload for all users.
       _drupal_flush_css_js();
 
-      drupal_clear_css_cache();
-      drupal_clear_js_cache();
+      \Drupal::service('asset.css.collection_optimizer')->deleteAll();
+      \Drupal::service('asset.js.collection_optimizer')->deleteAll();
 
       // Clear the page cache, since cached HTML pages might link to old CSS and
       // JS aggregates.
-      cache('page')->deleteAll();
+      \Drupal::cache('page')->deleteAll();
       break;
 
     case 'theme':
-      system_rebuild_theme_data();
+      \Drupal::service('theme_handler')->rebuildThemeData();
       drupal_theme_rebuild();
       break;
   }
diff --git a/admin_menu.map.inc b/admin_menu.map.inc
index 68b9bb4..ccdd9da 100644
--- a/admin_menu.map.inc
+++ b/admin_menu.map.inc
@@ -12,18 +12,19 @@
  *   it creates, so that this definition takes effect.
  */
 function node_admin_menu_map() {
-  if (user_access('administer content types')) {
+  $node_types = \Drupal\node\Entity\NodeType::loadMultiple();
+  if (\Drupal::currentUser()->hasPermission('administer content types')) {
     $map['admin/structure/types/manage/%node_type'] = array(
       'parent' => 'admin/structure/types',
       'arguments' => array(
-        array('%node_type' => array_keys(node_type_get_types())),
+        array('%node_type' => array_keys($node_types)),
       ),
     );
   }
   $map['node/add/%node_type'] = array(
     'parent' => 'node/add',
     'arguments' => array(
-      array('%node_type' => array_keys(node_type_get_types())),
+      array('%node_type' => array_keys($node_types)),
     ),
   );
   return $map;
@@ -34,7 +35,7 @@ function node_admin_menu_map() {
  */
 function admin_menu_admin_menu_map() {
   $map = array();
-  $entity_info = entity_get_info();
+  $entity_info = \Drupal::entityManager()->getDefinitions();
   foreach ($entity_info as $entity_type => $info) {
     // @todo Core: Allow to identify... config entity types, but exclude 'block'...
     if (!isset($info['config_prefix']) || $entity_type == 'block') {
@@ -114,9 +115,9 @@ function field_ui_admin_menu_map() {
         continue;
       }
       // @see field_ui_permission()
-      if (user_access('administer ' . $entity_type . ' fields')) {
+      if (\Drupal::currentUser()->hasPermission('administer ' . $entity_type . ' fields')) {
         $fields = array();
-        foreach (field_info_instances($entity_type, $bundle_name) as $field) {
+        foreach (\Drupal::entityManager()->getFieldDefinitions($entity_type, $bundle_name) as $field) {
           $fields[] = $field['field_name'];
         }
         if ($fields) {
diff --git a/admin_menu.module b/admin_menu.module
index fa2fb3d..f53a1fe 100644
--- a/admin_menu.module
+++ b/admin_menu.module
@@ -5,8 +5,15 @@
  * Render an administrative menu as a dropdown menu at the top of the window.
  */
 
+use Drupal\Component\Utility\String;
+use Drupal\Component\Utility\Unicode;
+use Drupal\Component\Utility\UrlHelper;
+use Drupal\Core\Form\FormState;
+use Drupal\Core\Language\LanguageInterface;
+use Drupal\Core\Render\Element;
 use Drupal\Core\Template\Attribute;
 use Drupal\Core\Cache\CacheBackendInterface;
+use Drupal\Core\Url;
 
 /**
  * Implements hook_help().
@@ -199,14 +206,27 @@ function admin_menu_library_info() {
  * Implements hook_page_bottom().
  */
 function admin_menu_page_bottom(array &$page_bottom) {
-  if (!user_access('access administration menu') || admin_menu_suppress(FALSE)) {
+  if (!\Drupal::currentUser()->hasPermission('access administration menu')) {
     return;
   }
-  // Performance: Skip this entirely for AJAX requests.
-  $current_path = current_path();
-  if (strpos($current_path, 'js/') === 0) {
+
+  if (admin_menu_suppress(FALSE)) {
+    $page_bottom['admin_menu_suppress'] = [
+      '#attached' => [
+        'drupalSettings' => [
+          'admin_menu' => ['suppress' => 1],
+        ],
+      ],
+    ];
     return;
   }
+
+  // Performance: Skip this entirely for non-HTML requests.
+  $request_format = \Drupal::service('request_stack')->getCurrentRequest()->getRequestFormat();
+  if ($request_format != 'html') {
+    return;
+  }
+
   global $user;
   $path = drupal_get_path('module', 'admin_menu');
 
@@ -223,22 +243,26 @@ function admin_menu_page_bottom(array &$page_bottom) {
   // @see http://drupal.org/node/1805452
   $options = array();
 
-  if ($user->uid == 1) {
+  if (\Drupal::currentUser()->id() == 1) {
     $attached['css'][$path . '/admin_menu.uid1.css'] = $options;
   }
 
   // Destination query strings are applied via JS.
-  $settings['destination'] = drupal_http_build_query(drupal_get_destination());
+  $settings['destination'] = UrlHelper::buildQuery(drupal_get_destination());
 
   // Determine whether we need to show all components and disable all caches.
   $complete = FALSE;
-  if (current_path() == 'admin/config/admin/admin_menu' && $_SERVER['REQUEST_METHOD'] == 'GET') {
+  /*
+  // TODO: disabled until hook_menu() is converted: https://www.drupal.org/node/2402185
+  if ($current_path == 'admin/config/admin/admin_menu' && $_SERVER['REQUEST_METHOD'] == 'GET') {
     $complete = TRUE;
   }
+  */
 
+  $langcode = Drupal::languageManager()->getCurrentLanguage(LanguageInterface::TYPE_INTERFACE)->getId();
   // If the client supports JavaScript and we have a cached menu for the current
   // user, only output the hash for the client-side HTTP cache callback URL.
-  $cid = 'admin_menu:' . $user->uid . ':' . session_id() . ':' . language(LANGUAGE_TYPE_INTERFACE)->langcode;
+  $cid = 'admin_menu:' . \Drupal::currentUser()->id() . ':' . session_id() . ':' . $langcode;
   if (!$complete && ($hash = admin_menu_cache_get($cid))) {
     $settings['hash'] = $hash;
     // The base path to use for cache requests depends on whether clean URLs
@@ -248,14 +272,14 @@ function admin_menu_page_bottom(array &$page_bottom) {
     // add further required components to the URL to provide context. Due to
     // those components, and since url('') returns only base_path() when clean
     // URLs are disabled, we need to use a replacement token as path.  Yuck.
-    $settings['basePath'] = url('admin_menu');
+    $settings['basePath'] = \Drupal::urlGenerator()->generateFromPath('admin_menu');
   }
   // Otherwise, add the full menu to the page.
   else {
     $page_bottom['admin_menu']['#markup'] = admin_menu_output($complete);
   }
 
-  $replacements = module_invoke_all('admin_menu_replacements', $complete);
+  $replacements = \Drupal::moduleHandler()->invokeAll('admin_menu_replacements', $complete);
   if (!empty($replacements)) {
     $settings['replacements'] = $replacements;
   }
@@ -281,12 +305,15 @@ function admin_menu_page_bottom(array &$page_bottom) {
   if ($setting = \Drupal::config('admin_menu.settings')->get('tweak_tabs')) {
     $settings['tweak_tabs'] = $setting;
   }
+  /*
+  // TODO: disabled until hook_menu() is converted: https://www.drupal.org/node/2402185
   if ($current_path == 'admin/modules' || strpos($current_path, 'admin/modules/list') === 0) {
     $settings['tweak_modules'] = \Drupal::config('admin_menu.settings')->get('tweak_modules');
   }
   if ($current_path == 'admin/people/permissions' || $current_path == 'admin/people/permissions/list') {
     $settings['tweak_permissions'] = \Drupal::config('admin_menu.settings')->get('tweak_permissions');
   }
+  */
 
   $attached['js'][] = array(
     'data' => array('admin_menu' => $settings),
@@ -308,10 +335,8 @@ function admin_menu_page_bottom(array &$page_bottom) {
  */
 function admin_menu_suppress($set = TRUE) {
   static $suppress = FALSE;
-  // drupal_add_js() must only be invoked once.
-  if (!empty($set) && $suppress === FALSE) {
+  if (!empty($set)) {
     $suppress = TRUE;
-    drupal_add_js(array('admin_menu' => array('suppress' => 1)), 'setting');
   }
   return $suppress;
 }
@@ -348,7 +373,7 @@ function admin_menu_cache_get($cid) {
     return FALSE;
   }
   if (!array_key_exists($cid, $cache)) {
-    $cache[$cid] = cache('admin_menu')->get($cid);
+    $cache[$cid] = \Drupal::cache('admin_menu')->get($cid);
     if ($cache[$cid] && isset($cache[$cid]->data)) {
       $cache[$cid] = $cache[$cid]->data;
     }
@@ -372,7 +397,7 @@ function admin_menu_cache_get($cid) {
  */
 function admin_menu_cache_set($cid, $data, array $tags) {
   if (\Drupal::config('admin_menu.settings')->get('cache_client')) {
-    cache('admin_menu')->set($cid, $data, CacheBackendInterface::CACHE_PERMANENT, $tags);
+    \Drupal::cache('admin_menu')->set($cid, $data, CacheBackendInterface::CACHE_PERMANENT, $tags);
   }
 }
 
@@ -382,6 +407,8 @@ function admin_menu_cache_set($cid, $data, array $tags) {
  * @see admin_menu_deliver()
  */
 function admin_menu_js_cache() {
+  /*
+  // @todo see https://www.drupal.org/node/2323571
   global $conf;
 
   // Suppress Devel module.
@@ -420,6 +447,7 @@ function admin_menu_js_cache() {
   // Retrieve and return the rendered menu.
   $content = admin_menu_output();
   return new Symfony\Component\HttpFoundation\Response($content);
+  */
 }
 
 /**
@@ -446,7 +474,7 @@ function admin_menu_admin_menu_replacements($complete) {
  * @see user_block(), user.module
  */
 function admin_menu_get_user_count() {
-  $interval   = REQUEST_TIME - variable_get('user_block_seconds_online', 900);
+  $interval   = REQUEST_TIME - 900;
   $count_anon = admin_menu_session_count($interval, TRUE);
   $count_auth = admin_menu_session_count($interval, FALSE);
 
@@ -489,12 +517,12 @@ function admin_menu_session_count($timestamp = 0, $anonymous = TRUE) {
  *   page.
  */
 function admin_menu_output($complete = FALSE) {
-  global $user;
 
   $cache_server_enabled = !$complete;
-  $langcode = language(LANGUAGE_TYPE_INTERFACE)->langcode;
-  $cid = 'admin_menu:' . $user->uid . ':' . session_id() . ':' . $langcode;
-  $tags = array('admin_menu' => TRUE, 'user' => $user->uid, 'language' => $langcode);
+  $langcode = Drupal::languageManager()->getCurrentLanguage(LanguageInterface::TYPE_INTERFACE)->getId();
+  $uid = \Drupal::currentUser()->id();
+  $cid = 'admin_menu:' . $uid . ':' . session_id() . ':' . $langcode;
+  $tags = array('admin_menu' => TRUE, 'user' => $uid, 'language' => $langcode);
 
   // Try to load and output administration menu from server-side cache.
   // @todo Duplicates the page cache? Page cache ID contains the hash that is
@@ -505,7 +533,7 @@ function admin_menu_output($complete = FALSE) {
   //   cache_page instead? (i.e., one cache to rule them all) However,
   //   cache_page is cleared very often.
   if ($cache_server_enabled) {
-    $cache = cache('menu')->get($cid);
+    $cache = \Drupal::cache('menu')->get($cid);
     if ($cache && isset($cache->data)) {
       $content = $cache->data;
     }
@@ -521,13 +549,8 @@ function admin_menu_output($complete = FALSE) {
     // Add site name as CSS class for development/staging theming purposes. We
     // leverage the cookie domain instead of HTTP_HOST to account for many (but
     // not all) multi-domain setups (e.g. language-based sub-domains).
-    $classes = 'admin-menu-site' . drupal_strtolower(preg_replace('/[^a-zA-Z0-9-]/', '-', $GLOBALS['cookie_domain']));
-    // Displace overlay.
-    // @see Drupal.overlay.create
-    // @see toolbar_preprocess_toolbar()
-    if (module_exists('overlay')) {
-      $classes .= ' overlay-displace-top';
-    }
+    $classes = 'admin-menu-site' . Unicode::strtolower(preg_replace('/[^a-zA-Z0-9-]/', '-', $GLOBALS['cookie_domain']));
+
     // @todo Always output container to harden JS-less support.
     $content['#prefix'] = '<div id="admin-menu" class="' . $classes . '"><div id="admin-menu-wrapper">';
     $content['#suffix'] = '</div></div>';
@@ -563,7 +586,7 @@ function admin_menu_output($complete = FALSE) {
 
     // Allow modules to enhance the menu.
     // Uses '_output' suffix for consistency with the alter hook (see below).
-    foreach (module_implements('admin_menu_output_build') as $module) {
+    foreach (\Drupal::moduleHandler()->getImplementations('admin_menu_output_build') as $module) {
       $function = $module . '_admin_menu_output_build';
       $function($content);
     }
@@ -571,14 +594,12 @@ function admin_menu_output($complete = FALSE) {
     // Allow modules to alter the output.
     // The '_output' suffix is required to prevent hook implementation function
     // name clashes with the contributed Admin module.
-    drupal_alter('admin_menu_output', $content);
+    \Drupal::moduleHandler()->alter('admin_menu_output', $content);
 
-    $content = drupal_render($content);
+    $content = \Drupal::service('renderer')->render($content);
 
     // Cache the menu for this user.
-    if ($cache_server_enabled) {
-      cache('menu')->set($cid, $content, CacheBackendInterface::CACHE_PERMANENT, $tags);
-    }
+    \Drupal::cache('menu')->set($cid, $content, CacheBackendInterface::CACHE_PERMANENT, $tags);
   }
 
   // Store the new hash for this user.
@@ -600,7 +621,7 @@ function admin_menu_admin_menu_output_build(&$content) {
   // Unassign weights for categories below Configuration.
   // An alphabetical order is more natural for a dropdown menu.
   if (isset($content['menu']['admin/config'])) {
-    foreach (element_children($content['menu']['admin/config']) as $key) {
+    foreach (Element::children($content['menu']['admin/config']) as $key) {
       $content['menu']['admin/config'][$key]['#weight_original'] = $content['menu']['admin/config'][$key]['#weight'];
       unset($content['menu']['admin/config'][$key]['#weight']);
     }
@@ -679,7 +700,7 @@ function theme_admin_menu_links($variables) {
   $elements['#sorted'] = TRUE;
 
   $output = '';
-  foreach (element_children($elements) as $path) {
+  foreach (Element::children($elements) as $path) {
     // Early-return nothing if user does not have access.
     if (isset($elements[$path]['#access']) && !$elements[$path]['#access']) {
       continue;
@@ -690,10 +711,10 @@ function theme_admin_menu_links($variables) {
     );
     // Render children to determine whether this link is expandable.
     if (isset($elements[$path]['#type']) || isset($elements[$path]['#theme']) || isset($elements[$path]['#pre_render'])) {
-      $elements[$path]['#children'] = drupal_render($elements[$path]);
+      $elements[$path]['#children'] = \Drupal::service('renderer')->render($elements[$path]);
     }
     else {
-      $elements[$path]['#children'] = theme('admin_menu_links', array('elements' => $elements[$path]));
+      $elements[$path]['#children'] = \Drupal::service('theme.manager')->render('admin_menu_links', array('elements' => $elements[$path]));
       if (!empty($elements[$path]['#children'])) {
         $elements[$path]['#attributes']['class'][] = 'expandable';
       }
@@ -720,7 +741,7 @@ function theme_admin_menu_links($variables) {
         $title = $elements[$path]['#title'];
       }
       else {
-        $title = check_plain($elements[$path]['#title']);
+        $title = String::checkPlain($elements[$path]['#title']);
       }
       $attributes = '';
       if (isset($elements[$path]['#options']['attributes'])) {
@@ -762,6 +783,9 @@ function admin_menu_element_sort($a, $b) {
 /**
  * Implements hook_translated_menu_link_alter().
  *
+ * @todo what to do with this: hook no longer exists in D8; see change record
+ * https://www.drupal.org/node/2302069.
+ *
  * Here is where we make changes to links that need dynamic information such
  * as the current page path or the number of users.
  */
@@ -830,10 +854,10 @@ function admin_menu_cache_flush($uid = NULL) {
     $tags['user'] = $uid;
   }
   // Flush cached output of admin_menu.
-  cache('menu')->invalidateTags($tags);
+  \Drupal::cache('menu')->invalidateTags($tags);
   // Flush client-side cache hashes.
   drupal_static_reset('admin_menu_cache_get');
-  cache('admin_menu')->invalidateTags($tags);
+  \Drupal::cache('admin_menu')->invalidateTags($tags);
 
   // Return value is only used by drupal_flush_all_caches().
   return array('admin_menu');
@@ -884,7 +908,7 @@ function admin_menu_form_alter_flush_cache_submit($form, &$form_state) {
  *
  * Extends Devel module with Administration menu developer settings.
  */
-function admin_menu_form_devel_admin_settings_alter(&$form, &$form_state) {
-  form_load_include($form_state, 'inc', 'admin_menu');
+function admin_menu_form_devel_admin_settings_alter(&$form, FormState $form_state) {
+  $form_state->loadInclude('inc', 'admin_menu');
   _admin_menu_form_devel_admin_settings_alter($form, $form_state);
 }
