| | |
| | | <?php |
| | | namespace JVBase\managers\SEO\render\Traits\_Properties; |
| | | |
| | | use JVBase\managers\SEO\render\Thing\Action; |
| | | use JVBase\inc\managers\SEO\render\Thing\Action\Action; |
| | | use JVBase\managers\SEO\render\Traits\_Helpers\arrayHelper; |
| | | |
| | | if (!defined('ABSPATH')) { |
| | |
| | | public function setPotentialAction(Action|array $potentialAction):void |
| | | { |
| | | if (is_array($potentialAction)) { |
| | | $potentialAction = $this->classArray('potentialAction', $potentialAction, 'JVBase\managers\SEO\render\Thing\Action'); |
| | | $potentialAction = $this->classArray('potentialAction', $potentialAction, 'JVBase\inc\managers\SEO\render\Thing\Action\Action'); |
| | | $potentialAction = array_map( |
| | | function ($item) { |
| | | $target = $item->getTarget(); |
| | | $url = $target->getUrlTemplate(); |
| | | $target->setId($url.'#entrypoint'); |
| | | |
| | | return $item; |
| | | }, |
| | | $potentialAction |
| | | ); |
| | | if (empty($potentialAction)) { |
| | | return; |
| | | } |