From 1aa7c404dae63c9518468fe9b579fad819f8d871 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sun, 13 Sep 2026 18:32:43 +0000
Subject: [PATCH] =Single Event page setup done through the new Event block. Currently working on the Simple Calendar block setup
---
inc/blocks/FAQBlock.php | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/inc/blocks/FAQBlock.php b/inc/blocks/FAQBlock.php
index fd6d84d..d218b17 100644
--- a/inc/blocks/FAQBlock.php
+++ b/inc/blocks/FAQBlock.php
@@ -1,20 +1,22 @@
<?php
namespace JVBase\blocks;
-use JVBase\managers\Cache;
+use JVBase\managers\DirectoryManager;
use JVBase\registrar\Registrar;
use WP_Block;
use WP_Query;
-
+if (!defined('ABSPATH')) {
+ exit;
+}
class FAQBlock {
- protected Cache $cache;
+// protected Cache $cache;
protected string $postType;
protected string $section;
protected string $slug;
protected bool $isDirectory;
public function __construct()
{
- $this->cache = Cache::for('faq_block', WEEK_IN_SECONDS)->connect('post', true)->connect('taxonomy', true);
+// $this->cache = Cache::for('faq_block', 'post', WEEK_IN_SECONDS);
add_action('init', [ $this, 'registerBlock' ]);
add_action('enqueue_block_editor_assets', [$this, 'localizeData']);
}
@@ -22,7 +24,8 @@
/**
* Register the FAQ block
*/
- public function registerBlock() {
+ public function registerBlock():void
+ {
// Register the block
register_block_type(
JVB_DIR . '/build/faq',
@@ -123,7 +126,7 @@
* @param WP_Block $block Block instance
* @return string Rendered block HTML
*/
- public function render($attributes, $content, $block)
+ public function render(array $attributes, string $content, WP_Block $block):string
{
ob_start();
?>
@@ -261,7 +264,7 @@
}
$buttons = '';
if ($this->isDirectory) {
- $directory = JVB()->directories()->directories($this->slug);
+ $directory = DirectoryManager::getInstance()->directories($this->slug);
$url = $directory['url']??'';
if (!empty($url)) {
$buttons .= '<li><a href="'.$url.'">'.__('See Alphabetical List', 'jvb').'</a></li>';
--
Gitblit v1.10.0