Conversion of URL in Cell to Plain Text
-
I have a table with several rows, the last cell of each row is a URL.
I had previously been using wpDataTables but responsive options were failing but the URL at least could be set by adding a pipe and the word that the URL would be represented by.
In this case I use “More…”
The responsive options in TablePress wirk much better for my needs but the Automatic URL Conversion does not.
Because this table is regularly updated by non-technical staff I need an easy way to convert the URL.
What I have done is gone to the formatting.php file in the WordPress core as I see that you are using the “make_clickable” function.
I updated the following line in the function “_make_url_clickable_cb”:
return $matches[1] . "<a href="$url" rel="nofollow">$url</a>" . $suffix;
and changed it to this:
return $matches[1] . "<a href="$url" rel="nofollow">More...</a>" . $suffix;
This does exactly what I need, replacing all the URLs with the word More…
This of course is not sustainable since this file will most likely be overwritten in the next WordPress update. Plus it effects all URL conversion in the site.
Can you add some functionality in TablePress to allow for easier customasition like this?Great work by the way.
- The topic ‘Conversion of URL in Cell to Plain Text’ is closed to new replies.