Jake Vanderwerf
2026-08-30 87237f15618e2320967b9380c360b89f7323d2e9
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']);
   }
@@ -261,7 +263,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>';