• Hi, as my pseudo says i’m very lazy. I’m working on a wp site with lot of phone number (and mail adress). In order to have more interactivity, I want transform theses phones numbers into link with tel:+…. (I’m in France so the phone number is tel:+336 …).

    I didn’t found plugins or whatever, maybe you have tools or plugins ?

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    The solution depends on how the numbers came to appear on the site. Numbers in a widget may need a different solution than numbers in page content. For numbers in page content, you could use the “the_content” filter and some custom code that matches phone numbers in content against a regular expression. If such numbers are not already in a link, turn them into one. preg_replace() can be used to find all phone numbers and replace them with “linkified” versions.

    The drawback of using the filter is the entire process needs to be repeated every time a page is requested. It’d be better if the numbers were linkified permanently in the saved data. Apps that can search and replace data in the DB using regular expressions are not plentiful, but the utility offered by interconnect is capable of this.

    The interconnect utility can really scramble your data if it is used improperly. It’s imperative that you make a complete DB backup before trying to use this utility.

Viewing 1 replies (of 1 total)
  • The topic ‘Automatical transform phone number into tel: link’ is closed to new replies.