How do I remove spaces from phone number so tel: will work?
-
Hi – I think I’m missing something simple here.
I have an ACF subfield within a repeater field called ‘phonenumber’. In the back end of the site the client populates this with the phone number including country code and spaces in order to make it easy to read.
On the front end I am trying to create a tel: link so that people can easily click on the phone number to call it directly. I’m using this:
[repeater offices_0_phone] [field phonename]: <a href="tel:field phonenumber">[field phonenumber]</a>[/repeater]
But the output is that it replaces all the spaces with %20. So if for example the phone number is +44 1234 567890 then the link becomes +44%201234%20567890.
So how can I remove the spaces from the phone number?
Thanks for your time.
- This topic was modified 3 years, 7 months ago by .
- This topic was modified 3 years, 7 months ago by .
- This topic was modified 3 years, 7 months ago by .
- This topic was modified 3 years, 7 months ago by .
- This topic was modified 3 years, 7 months ago by .
- This topic was modified 3 years, 7 months ago by .
Viewing 14 replies - 1 through 14 (of 14 total)
Viewing 14 replies - 1 through 14 (of 14 total)
- The topic ‘How do I remove spaces from phone number so tel: will work?’ is closed to new replies.