Filter: postie_bare_link

This filter is called for each bare link Postie finds in your message. Bare links are plain URLs without any markup. I.e. “http://www.example.com” is a bare link. “Not a bare link” is not a bare link. Note some email clients will transform bare links into non-bare links especially if you are using rich text/html. Generally if you want to take advantage of this filter consistently you will want to set Preferred Text Type to Plain.

Parameters:

You must return a string that will be placed at the spot where the bare URL was found.

Example

add_filter('postie_bare_link', 'my_postie_bare_link', 10, 3);

function my_postie_bare_link($html, $url, $oembed) {
    if ($oembed)
        return htmlspecialchars($url);
    else
        return "<div class='mylinkclass'>$html</div>";
}