Jake Vanderwerf
2026-02-17 a24a06002081ad71a78ffeff9072725ba39cf121
inc/managers/SEO/TemplateResolver.php
@@ -1,7 +1,7 @@
<?php
namespace JVBase\managers\SEO;
use JVBase\meta\MetaManager;
use JVBase\meta\Meta;
use WP_Post;
use WP_Term;
use WP_User;
@@ -25,7 +25,7 @@
   private ?int $objectId = null;
   private ?string $objectType = null;
   private ?string $contentType = null;
   private ?MetaManager $meta = null;
   private ?Meta $meta = null;
   private array $context = [];
   private array $fieldDefinitions = [];
@@ -39,7 +39,7 @@
      $this->contentType = $contentType;
      if ($objectId && $objectType) {
         $this->meta = new MetaManager($objectId, $objectType, $contentType);
         $this->meta = new Meta($objectId, $objectType, $contentType);
         $this->loadFieldDefinitions();
      }
@@ -133,9 +133,9 @@
         return $special;
      }
      // Try to get from MetaManager
      // Try to get from Meta.php
      if ($this->meta) {
         $value = $this->meta->getValue($variable);
         $value = $this->meta->get($variable);
         // Auto-resolve complex field types via SchemaFieldHelpers
         $value = $this->autoResolveField($variable, $value);
@@ -384,7 +384,7 @@
      // Check field definitions for taxonomy or post relations
      if (isset($this->fieldDefinitions[$relation])) {
         $fieldDef = $this->fieldDefinitions[$relation];
         $value = $this->meta->getValue($relation);
         $value = $this->meta->get($relation);
         if (!$value) {
            return null;
@@ -451,7 +451,7 @@
      // Image URL accessors for different sizes
      if (str_ends_with($variable, '_image_url')) {
         $field = str_replace('_image_url', '', $variable);
         $imageId = $this->meta?->getValue($field);
         $imageId = $this->meta?->get($field);
         if ($imageId) {
            return wp_get_attachment_image_url($imageId, 'full') ?: '';
         }
@@ -501,7 +501,7 @@
    */
   private function resolveLocationComponent(string $component): string
   {
      $location = $this->meta?->getValue('location');
      $location = $this->meta?->get('location');
      if (!is_array($location)) {
         return '';
@@ -607,8 +607,8 @@
      } elseif ($this->objectType === 'term' && $this->objectId) {
         $term = get_term($this->objectId);
         if ($term && !is_wp_error($term)) {
            $this->context['term_name'] = $term->name;
            $this->context['term_description'] = $term->description;
            $this->context['term_name'] = html_entity_decode($term->name);
            $this->context['term_description'] = wptexturize($term->description);
            $this->context['taxonomy'] = $term->taxonomy;
         }
      } elseif ($this->objectType === 'user' && $this->objectId) {