• Resolved pjharley

    (@pjharley)


    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.

    • This topic was modified 7 years, 10 months ago by pjharley.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your question, and sorry for the trouble.

    The best approach for this should be to use the TablePress Extension that you have already found. However, instead of letting it call make_clickable(), you would add your own version of the make_clickable() function to that file as well, and just give it a different name.
    Then, a WordPress update won’t break this, because you the Extension now uses your own custom function.

    Regards,
    Tobias

    Thread Starter pjharley

    (@pjharley)

    Thanks for the prompt reply.
    That was my thought too. Just needed it confirmed.
    Keep up the good work.
    Thanks.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! ?? Good to hear that this helped!

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Conversion of URL in Cell to Plain Text’ is closed to new replies.