Jake Vanderwerf
2026-01-25 b38f03c0e7218762d90fa5092696b127f24f36db
inc/blocks/MenuBlock.php
@@ -1,7 +1,7 @@
<?php
namespace JVBase\blocks;
use JVBase\managers\CacheManager;
use JVBase\managers\Cache;
use JVBase\forms\TaxonomySelector;
use JVBase\meta\MetaManager;
use WP_Block;
@@ -13,7 +13,7 @@
class MenuBlock
{
    protected CacheManager $cache;
    protected Cache $cache;
    protected string $config;
    protected string $type;
    protected string $path = JVB_DIR . '/build/menu';
@@ -27,7 +27,7 @@
    public function __construct()
    {
        $this->cache = CacheManager::for('menu', WEEK_IN_SECONDS)->connectTo('post', 'menu_item');
        $this->cache = Cache::for('menu', WEEK_IN_SECONDS)->connectTo('post', 'menu_item');
        add_action('init', [ $this, 'registerBlock' ]);
    }
@@ -57,16 +57,14 @@
         return '';
      }
      $key = $this->cache->generateKey($this->params);
        $cache = $this->cache->get($key);
        if ($cache) {
            return $cache;
        }
        ob_start();
        $this->renderBlock();
        $content = ob_get_clean();
        $this->cache->set($key, $content);
        return $content;
      return $this->cache->remember(
         $key,
         function() {
            ob_start();
            $this->renderBlock();
            return ob_get_clean();
         }
      );
    }
    protected function renderBlock():void