From b38f03c0e7218762d90fa5092696b127f24f36db Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sun, 25 Jan 2026 07:07:26 +0000
Subject: [PATCH] =Some logical flaws in Queue.php, Queue.js, ContentExecutor.php, UploadExecutor.php - particularly with timeline ordering, frontend queue updates, etc
---
inc/blocks/MenuBlock.php | 24 +++++++++++-------------
1 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/inc/blocks/MenuBlock.php b/inc/blocks/MenuBlock.php
index e52f2a2..88fd26a 100644
--- a/inc/blocks/MenuBlock.php
+++ b/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
--
Gitblit v1.10.0