Jake Vanderwerf
2026-01-28 8c6502de2f8ec2bd8382cd6945c327d7be400e14
inc/managers/DirectoryManager.php
@@ -6,6 +6,7 @@
}
use JVBase\registry\PostTypeRegistrar;
use JVBase\managers\Cache;
use JVBase\utility\Features;
use WP_Block;
use WP_Query;
@@ -18,7 +19,7 @@
   protected int $perPage;
    protected static string $type = BASE.'for_type';
    protected static string $slug = BASE.'for_type_slug';
    protected CacheManager $cache;
    protected Cache $cache;
    public function __construct($perPage = 100)
    {
@@ -27,18 +28,15 @@
            return;
        }
      $this->perPage = $perPage;
        $this->cache = CacheManager::for('directory', WEEK_IN_SECONDS);
        $this->cache = Cache::for('directory', WEEK_IN_SECONDS);
      $this->cache->connect('post', true)
         ->connect('taxonomy', true)
         ->connect('user', true);
      if (JVB_TESTING) {
         $this->cache->clear();
         $this->cache->flush();
      }
      foreach(['content','taxonomy','user'] as $key) {
         if (array_key_exists($key, $this->directories)) {
            $this->cache->connectTo($key);
         }
      }
      add_action('init', [$this, 'registerDirectories']);
      jvb_register_do_once('directories_registered', [$this, 'activate']);
        add_action('render_block', [$this, 'renderBlock'], 99999, 3);
@@ -445,7 +443,7 @@
                              if ( $terms && ! is_wp_error( $terms ) ) {
                                 $term    = $terms[0];
                                 $extra[] = [
                                    'name' => (get_term_meta( $term->term_id, BASE . 'singular', true ) !== '') ? get_term_meta( $term->term_id, BASE . 'singular', true ) : $term->name,
                                    'name' => (get_term_meta( $term->term_id, BASE . 'singular', true ) !== '') ? get_term_meta( $term->term_id, BASE . 'singular', true ) : html_entity_decode($term->name),
                                    'url'  => get_term_link( $term->term_id, $item ),
                                    'id'   => $term->term_id,
                                    'type' => $item,
@@ -489,7 +487,7 @@
                        $list = $this->alphabetizeMe(
                           $list,
                           $term->name,
                           html_entity_decode($term->name),
                           get_term_link( $term->term_id, jvbCheckBase( $slug ) ),
                           $term->term_id,
                           $extra
@@ -580,11 +578,11 @@
         $children =$this->renderListChunk($taxonomy, $term->term_id);
         $out .= '<li>';
         if ($children !== '') {
            $out .= '<details class="term"><summary class="row btw"><a href="'.get_term_link($term->term_id, $term->taxonomy).'" title="See more '.$term->name.'">'.$term->name.'</a></summary>';
            $out .= '<details class="term"><summary class="row btw"><a href="'.get_term_link($term->term_id, $term->taxonomy).'" title="See more '.html_entity_decode($term->name).'">'.$term->name.'</a></summary>';
            $out .= $children;
            $out .= '</details>';
         } else {
            $out .= '<a href="'.get_term_link($term->term_id, $term->taxonomy).'" title="See more '.$term->name.'">'.$term->name.'</a>';
            $out .= '<a href="'.get_term_link($term->term_id, $term->taxonomy).'" title="See more '.$term->name.'">'.html_entity_decode($term->name).'</a>';
         }
         $out .= '</li>';
        }