<?php
|
namespace JVBase\managers\SEO\render\Traits\_Properties;
|
|
use JVBase\meta\Sanitizer;
|
|
if (!defined('ABSPATH')) {
|
exit;
|
}
|
trait telephoneTrait {
|
/**
|
* @var string The telephone number
|
*/
|
protected string $telephone;
|
|
public function getTelephone():?string
|
{
|
return $this->telephone??null;
|
}
|
public function setTelephone(string $telephone):void
|
{
|
if (Sanitizer::sanitizePhone($telephone) === '') {
|
error_log('[SEO]Telephone is not valid');
|
return;
|
}
|
$this->telephone = $telephone;
|
}
|
|
public function getTelephoneFieldConfig():array
|
{
|
return [
|
'type' => 'tel',
|
'label' => 'Telephone',
|
];
|
}
|
}
|