WordPress, is there a hook for insert/edit link in post page?

I am trying to add http:// in the post link dialog box if there is not already added. I tried with filter

add_filter('pre_link_url', 'add_http_link_url');

It didn’t work. Does anybody know how to do that ?

Related posts

Leave a Reply

1 comment

  1. Doesn’t WordPress automatically add the “http://” there by default?

    Maybe this plugin would help?
    wordpress.org/extend/plugins/auto-hyperlink-urls/

    EDIT

    found this on http://betterwp.net/wordpress-tips/make-links-clickable/

    a function named make_clickable() that can be found in wp-includes/formatting.php.

    make_clickable() filters the comment_text hook with this:

    add_filter( 'comment_text', 'make_clickable',      9 );
    

    Since it is that simple, let’s try adding the same filter to our post contents and see if it works

    add_filter( 'the_content', 'make_clickable',      12 );
    

    The priority of 12 as used above simply tells WordPress to make links clickable for post contents after shortcodes are parsed (which is at priority 11). If you don’t like such behaviour, just change 12 to any number you want. You should take a look at wp-includes/default-filters.php to choose an appropriate priority for make_clickable().

    Being that awesome, however, make_clickable() has a limitation, which you can clearly see in this clickable link: http://codex.wordpress.org/Function_Reference/make_clic … _clickable.

    See the full stop punctuation mark also included in the link, thus making it broken? To avoid such behaviour you must always have one space plus another character after a plain link, or in other words, never put a plain link like that at the end of a paragraph. In case you must, just make the link clickable the normal way .

    Of course if you don’t like your visitors to be able to post links that way you can easily remove the filter using:

    remove_filter('comment_text', 'make_clickable', 9);
    

    hope this helps, sorry i had to remove the first link as i can only post 2 links till i get my rep up 🙂