<?php
|
namespace JVBase\managers\SEO\render\Traits\_Properties;
|
|
if (!defined('ABSPATH')) {
|
exit;
|
}
|
trait urlTrait {
|
/**
|
* @var string URL of the item.
|
*/
|
protected string $url;
|
|
public function getUrl():?string
|
{
|
return $this->url??null;
|
}
|
public function setUrl(string $url):void
|
{
|
if (!filter_var($url, FILTER_VALIDATE_URL)) {
|
error_log('[SEO]Not a valid url: '.$url);
|
return;
|
}
|
$this->url = $url;
|
}
|
|
public function getUrlFieldConfig():array
|
{
|
return [
|
'type' => 'url',
|
'label' => 'URL',
|
'hint' => 'The main url of this Thing.'
|
];
|
}
|
}
|