Jake Vanderwerf
2026-08-28 a9654f00c8fbc9934289d761843ddd071025013f
inc/managers/TaxonomyRelationships.php
@@ -2,6 +2,8 @@
namespace JVBase\managers;
use Exception;
use JVBase\Instance;
use JVBase\managers\queue\Queue;
use WP_Error;
use WP_Post;
use WP_Query;
@@ -12,15 +14,15 @@
class TaxonomyRelationships
{
   use Instance;
    protected Cache $cache;
   protected CustomTable $relationships;
    public function __construct()
    private function __construct()
    {
      $this->defineTables();
        $this->cache = Cache::for('term_relationship', WEEK_IN_SECONDS);
      $this->cache->connect('terms');
        $this->cache = Cache::for('term_relationship', 'term', WEEK_IN_SECONDS);
        // Ensure the table exists
//        $this->create_table_if_not_exists();
@@ -196,7 +198,7 @@
    {
        $term_posts = $this->cache->remember(
         $this->cache->generateKey(['term' => $term_id, 'taxonomy' => $taxonomy]),
         ['id' => $term_id, 'taxonomy' => $taxonomy],
         function () use ($term_id, $taxonomy) {
            global $wpdb;
            return $wpdb->get_col($wpdb->prepare(
@@ -211,7 +213,7 @@
        $related_term_posts = $this->cache->remember(
         $this->cache->generateKey(['term' => $related_term_id, 'taxonomy' => $related_taxonomy]),
         ['id' => $related_term_id, 'taxonomy' => $related_taxonomy],
         function () use($related_term_id, $related_taxonomy) {
            global $wpdb;
            return $wpdb->get_col($wpdb->prepare(
@@ -292,7 +294,7 @@
        // Queue the operation
        $queue = JVB()->queue();
        $queue = Queue::getInstance();
        $queue->queueOperation(
            'taxonomy_relationships',