Fixed cache logic not checking for the shortcode name when processing shortcode list...
authorChuck Scott <cscott@gaslightmedia.com>
Tue, 23 May 2017 15:54:36 +0000 (11:54 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Tue, 23 May 2017 15:54:36 +0000 (11:54 -0400)
controllers/front.php

index 276d555..ea329d5 100644 (file)
@@ -292,13 +292,14 @@ class glmMembersFront extends GlmPluginSupport
             // Check shortcode for cache configuration
             $scCacheControl = false;
             foreach ($this->config['addOns'] as $addon) {
-                foreach ($addon['shortcodes'] as $sc) {
-                    if (isset($sc['cacheControl'])) {
-                        $scCacheControl = $sc['cacheControl'];
+                while (list($key, $val) = each($addon['shortcodes'])) {
+                    if ($key == $shortcode && isset($val['cacheControl'])) {
+                        $scCacheControl = $val['cacheControl'];
                     }
                 }
             }
 
+            // If cache control is enabled for this shortcode
             if ($scCacheControl && $scCacheControl['active']) {
 
                 // Create cache_code for this request