diff --git a/views.module b/views.module
index 6c8a54731827ab4fe68256892d381fa272ce4507..d03642bd7f4f2150c1a7cce80e8ad7a7b7e2cbe8 100644
--- a/views.module
+++ b/views.module
@@ -1333,6 +1333,11 @@ function views_fetch_plugin_names($type, $key = NULL, $base = array()) {
   $plugins = array();
 
   foreach ($definitions as $plugin_id => $plugin) {
+    // Skip plugins that don't conform to our key.
+    if ($key && (empty($plugin['type']) || $plugin['type'] != $key)) {
+      continue;
+    }
+
     if (empty($plugin['no ui']) && (empty($base) || empty($plugin['base']) || array_intersect($base, $plugin['base']))) {
       $plugins[$plugin_id] = $plugin['title'];
     }