diff --git a/includes/content.inc b/includes/content.inc
index 16f0a68..f0f9f6a 100644
--- a/includes/content.inc
+++ b/includes/content.inc
@@ -736,6 +736,16 @@ function ctools_content_select_context($plugin, $subtype, $conf, $contexts) {
   }
 
   if (!empty($subtype_info['all contexts']) || !empty($plugin['all contexts'])) {
+    // If an array of specific contexts is requested maintain the order.
+    if (!empty($subtype_info['required context']) && is_array($subtype_info['required context'])) {
+      $ordered_contexts = array();
+      foreach ($subtype_info['required context'] as $id => $r) {
+        if (!empty($r)) {
+          $ordered_contexts[$conf['context'][$id]] = _ctools_context_select($contexts, $r, $conf['context'][$id]);
+        }
+      }
+      $contexts = $ordered_contexts + $contexts;
+    }
     return $contexts;
   }
 
