diff --git a/core/modules/views/lib/Drupal/views/Plugin/block/block/ViewsBlock.php b/core/modules/views/lib/Drupal/views/Plugin/block/block/ViewsBlock.php
index 296212c..5040e70 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/block/block/ViewsBlock.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/block/block/ViewsBlock.php
@@ -77,9 +77,35 @@ public function blockBuild() {
     $this->configuration['subject'] = filter_xss_admin($this->view->getTitle());
     // Before returning the block output, convert it to a renderable array
     // with contextual links.
-    views_add_block_contextual_links($output, $this->view, $this->displayID);
+    $this->addContextualLinks($output);
+
     $this->view->destroy();
     return $output;
   }
 
+  /**
+  * Converts Views block content to a renderable array with contextual links.
+  *
+  * @param string|array $block
+  *   An string|array representing the block. This will be modified to be a
+  *   renderable array, containing the optional '#contextual_links' property (if
+  *   there are any contextual links associated with the block).
+  * @param $block_type
+  *   The type of the block. If it's 'block' it's a regular views display,
+  *   but 'exposed_filter' exist as well.
+  */
+  protected function addContextualLinks(&$block, $block_type = 'block') {
+    // Do not add contextual links to an empty block.
+    if (!empty($block)) {
+      // Contextual links only work on blocks whose content is a renderable
+      // array, so if the block contains a string of already-rendered markup,
+      // convert it to an array.
+      if (is_string($block)) {
+        $block = array('#markup' => $block);
+      }
+      // Add the contextual links.
+      views_add_contextual_links($block, $block_type, $this->view, $this->displayID);
+    }
+  }
+
 }
diff --git a/core/modules/views/lib/Drupal/views/Plugin/block/block/ViewsExposedFilterBlock.php b/core/modules/views/lib/Drupal/views/Plugin/block/block/ViewsExposedFilterBlock.php
index 2d51c25..2d0fb14 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/block/block/ViewsExposedFilterBlock.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/block/block/ViewsExposedFilterBlock.php
@@ -26,11 +26,11 @@ class ViewsExposedFilterBlock extends ViewsBlock {
    * Implements \Drupal\block\BlockBase::blockBuild().
    */
   public function blockBuild() {
-    $type = 'exp';
-    $output = $this->view->display_handler->viewSpecialBlocks($type);
+    $output = $this->view->display_handler->viewExposedFormBlocks();
     // Before returning the block output, convert it to a renderable array with
     // contextual links.
-    views_add_block_contextual_links($output, $this->view, $this->display_id, 'special_block_' . $type);
+    $this->addContextualLinks($output, 'exposed_filter');
+
     $this->view->destroy();
     return $output;
   }
diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
index b31af4b..851ffb4 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
@@ -2667,20 +2667,21 @@ public function getSpecialBlocks() {
   }
 
   /**
-   * Render any special blocks provided for this display.
+   * Render the exposed form as block.
+   *
+   * @return string|NULL
+   *  The rendered exposed form as string or NULL otherwise.
    */
-  public function viewSpecialBlocks($type) {
-    if ($type == 'exp') {
-      // avoid interfering with the admin forms.
-      if (arg(0) == 'admin' && arg(1) == 'structure' && arg(2) == 'views') {
-        return;
-      }
-      $this->view->initHandlers();
+  public function viewExposedFormBlocks() {
+    // avoid interfering with the admin forms.
+    if (arg(0) == 'admin' && arg(1) == 'structure' && arg(2) == 'views') {
+      return;
+    }
+    $this->view->initHandlers();
 
-      if ($this->usesExposed() && $this->getOption('exposed_block')) {
-        $exposed_form = $this->getPlugin('exposed_form');
-        return $exposed_form->render_exposed_form(TRUE);
-      }
+    if ($this->usesExposed() && $this->getOption('exposed_block')) {
+      $exposed_form = $this->getPlugin('exposed_form');
+      return $exposed_form->render_exposed_form(TRUE);
     }
   }
 
diff --git a/core/modules/views/views.module b/core/modules/views/views.module
index f4d8404..23b8149 100644
--- a/core/modules/views/views.module
+++ b/core/modules/views/views.module
@@ -519,38 +519,6 @@ function views_contextual_links_view_alter(&$element, $items) {
 }
 
 /**
- * Converts Views block content to a renderable array with contextual links.
- *
- * @param $block
- *   An array representing the block, with the same structure as the return
- *   value of hook_block_view(). This will be modified so as to force
- *   $block['content'] to be a renderable array, containing the optional
- *   '#contextual_links' property (if there are any contextual links associated
- *   with the block).
- * @param $view
- *   The view that was used to generate the block content.
- * @param $display_id
- *   The ID of the display within the view that was used to generate the block
- *   content.
- * @param $block_type
- *   The type of the block. If it's block it's a regular views display,
- *   but 'special_block_-exp' exist as well.
- */
-function views_add_block_contextual_links(&$block, ViewExecutable $view, $display_id, $block_type = 'block') {
-  // Do not add contextual links to an empty block.
-  if (!empty($block)) {
-    // Contextual links only work on blocks whose content is a renderable
-    // array, so if the block contains a string of already-rendered markup,
-    // convert it to an array.
-    if (is_string($block)) {
-      $block = array('#markup' => $block);
-    }
-    // Add the contextual links.
-    views_add_contextual_links($block, $block_type, $view, $display_id);
-  }
-}
-
-/**
  * Adds contextual links associated with a view display to a renderable array.
  *
  * This function should be called when a view is being rendered in a particular
@@ -635,7 +603,7 @@ function views_add_contextual_links(&$render_element, $location, ViewExecutable
     }
 
     // On exposed_forms blocks contextual links should always be visible.
-    $plugin['contextual_links_locations'][] = 'special_block_-exp';
+    $plugin['contextual_links_locations'][] = 'exposed_filter';
     $has_links = !empty($plugin['contextual links']) && !empty($plugin['contextual_links_locations']);
     if ($has_links && in_array($location, $plugin['contextual_links_locations'])) {
       foreach ($plugin['contextual links'] as $module => $link) {
