Jake Vanderwerf
2026-01-25 b38f03c0e7218762d90fa5092696b127f24f36db
inc/blocks/FormBlock.php
@@ -1,7 +1,7 @@
<?php
namespace JVBase\blocks;
use JVBase\managers\CacheManager;
use JVBase\managers\Cache;
use JVBase\meta\MetaManager;
use JVBase\managers\CloudflareTurnstile;
use Exception;
@@ -19,8 +19,8 @@
 */
class FormBlock
{
   protected static FormBlock|null $instance = null;
   protected CacheManager $cache;
   protected static ?FormBlock $instance = null;
   protected Cache $cache;
   protected array $forms;
   protected string $form_contact;
@@ -36,7 +36,7 @@
   public function __construct()
   {
      $this->cache = CacheManager::for('form_blocks', WEEK_IN_SECONDS);
      $this->cache = Cache::for('forms', WEEK_IN_SECONDS);
      // Initialize forms from filter
      $this->forms = $this->registerForms();
      $this->form_contact = apply_filters('jvb_form_contact', '');
@@ -131,16 +131,12 @@
      }
      $cache_key = $this->cache->generateKey($block);
      $cached = $this->cache->get($cache_key);
      $cached = false;
      if ($cached) {
         return $cached;
      }
      $rendered = $this->renderForm($form_type, $block);
      $this->cache->set($cache_key, $rendered);
      return $rendered;
      return $this->cache->remember(
         $cache_key,
         function() use ($form_type, $block) {
            return $this->renderForm($form_type, $block);
         }
      );
   }
   /**