Automatic URL conversion

To add links to table cells, you’ll in general need to manually enter the HTML code for a link (something like <a href="">My Link</a>) into a cell or use the “Insert Link” button, that will ask you for the URL and the link text and then generates the necessary HTML code for you. This is the recommended way and for most needs it works fine. It also allows for the most flexibility, because you have all freedom to alter or extend that HTML code as you like, e.g. by adding further attributes or a different link text.

Unfortunately it can be a real hassle and a lot of work, if all you want to achieve is, to make URLs you enter “clickable”, i.e. to make them valid HTML links. That can for example be the case when you import a table from a file, because in most cases URLs are not exported as HTML links by a program but simply as the plain URL in text form.

And this is were this Extension kicks in. When a table is shown in a post or page, the Extension will check if there’s an URL (for www, ftp or an email address) somewhere. And if it finds one, it will replace the URL with a complete HTML link to that URL that can be clicked by the visitor. The good thing: If there already was a complete HTML link, it will be left intact.

Here’s an example:

A cell with the content language: HTML, XML (xml)

will automatically be converted to a clickable link:

<a href=""></a>Code language: HTML, XML (xml)

To use this, download, install, and activate the Extension like a regular WordPress plugin. Then, on the page where you want to show the table, insert the extended Shortcode

[table id=123 automatic_url_conversion=true /]Code language: JSON / JSON with Comments (json)

and change the 123 to the desired table ID. This will activate the automatic URL conversion for that table.

Additionally, some people might want to have links open in a new browser window or tab automatically (Note that this is not recommended by web experts, as it takes away the user’s freedom and is considered bad for accessibility reasons. Personally, I totally agree with them, I hate when a site does this.). If you also want to do that, just extend your Shortcode with another parameter, to

[table id=123 automatic_url_conversion=true automatic_url_conversion_new_window=true /]Code language: JSON / JSON with Comments (json)

The automatic_url_conversion_new_window will add the HTML target="_blank" attribute to the link HTML, which tells the browser to open the link in a new window or tab.

If you want links to have the rel="nofollow" attribute set, so that search engines don’t follow the link, just add the automatic_url_conversion_rel_nofollow parameter to the Shortcode:

[table id=123 automatic_url_conversion=true automatic_url_conversion_rel_nofollow=true /]Code language: JSON / JSON with Comments (json)