Jake Vanderwerf
2026-05-03 9bbeea742424837fb58207d88e10dbca0b2cae04
inc/managers/SEO/render/Traits/_Properties/targetTrait.php
@@ -1,6 +1,7 @@
<?php
namespace JVBase\managers\SEO\render\Traits\_Properties;
use JVBase\base\SchemaHelper;
use JVBase\managers\SEO\render\Thing\Intangible\EntryPoint;
if (!defined('ABSPATH')) {
@@ -8,16 +9,26 @@
}
trait targetTrait {
   /**
    * @var EntryPoint|string Indicates a target EntryPoint, or url, for an Action.
    * @var EntryPoint Indicates a target EntryPoint, or url, for an Action.
    */
   protected EntryPoint|string $description;
   protected EntryPoint $target;
   public function getDescription():EntryPoint|string|null
   public function getTarget():EntryPoint|null
   {
      return $this->description??null;
      return $this->target??null;
   }
   public function setDescription(EntryPoint|string $description):void
   public function setTarget(EntryPoint|string $target):void
   {
      $this->description = $description;
      if (is_string($target)) {
         if (str_starts_with($target, '/')) {
            $target = home_url().$target;
         }
         $temp = [
            'type'   => 'JVBase\managers\SEO\render\Thing\Intangible\EntryPoint',
            'urlTemplate'  => $target
         ];
         $target = SchemaHelper::classFromConfig($temp);
      }
      $this->target = $target;
   }
}