Hi. Im new here. I have problem with phone numbers. I used this code to make Phone number type :
add_filter(
'hivepress/v1/fields/phone/display_value',
function($value){
$listing = hivepress()->request->get_context('listing');
if(!$listing){
return $value;
}
// display phone number
return preg_replace('~.*(\d{3})[^\d]{0,7}(\d{3})[^\d]{0,7}(\d{3})[^\d]{0,7}.*~', '+48 $1-$2-$3', $value);
},
1000
);
and it looks good, but I need to make an option when the user enters their own number in the form so that they cannot use more digits than are allowed in my country.
Another problem I have with display phone number. I use this code :
<button type="button" class="hp-listing__action hp-listing__action--message button button--large button--primary alt" data-component="link" data-url="tel:%value%">%icon% %value%</button>
But a button is not 100% width
Sorry for my english.