kompass/components/partials/telephon-link.php

13 lines
441 B
PHP
Raw Permalink Normal View History

<?php
2024-05-27 16:59:30 +02:00
function kompass_get_telephone_link(string $telephonnumber) : string {
$numberInternational = $telephonnumber;
if (str_starts_with($numberInternational, '0')) {
$numberInternational = '+49' . substr($numberInternational,1);
}
return '<a href="tel:' . $numberInternational . '">' . $telephonnumber . '</a>';
}
function kompass_print_telephone_link(string $telephonnumber)
{
2024-05-27 16:59:30 +02:00
echo kompass_get_telephone_link($telephonnumber);
}