Jake Vanderwerf
2026-08-30 a58a2e7ca4700d3e23341fde767060a4c2c704a3
checks.php
@@ -37,26 +37,30 @@
function jvbTermHasPosts(int $termID, string $taxonomy):bool
{
   $cache = Cache::for('termUtility', 30*60)->connect('taxonomy');
   $cache = Cache::for('termUtility', 'term', 30*60);
   return $cache->remember(
      $termID,
      function() use($taxonomy, $termID) {
         $taxonomy = jvbCheckBase($taxonomy);
         $tax = get_taxonomy($taxonomy);
         $query = new WP_Query([
            'post_type' => $tax->object_type,
            'posts_per_page' => 1,
            'fields' => 'ids',
            'tax_query' => [
               [
                  'taxonomy' => $taxonomy,
                  'terms'  => $termID
         if ($tax) {
            $query = new WP_Query([
               'post_type' => $tax->object_type,
               'posts_per_page' => 1,
               'fields' => 'ids',
               'tax_query' => [
                  [
                     'taxonomy' => $taxonomy,
                     'terms'  => $termID
                  ]
               ]
            ]
         ]);
         $result = ($query->have_posts()) ? 'true' : 'false';
         wp_reset_postdata();
         return $result;
            ]);
            $result = ($query->have_posts()) ? 'true' : 'false';
            wp_reset_postdata();
            return $result;
         }
         return 'false';
      }
   );
}