• Hi there,
    I am wondering if there is a hook/function I can add to functions.php to achieve the following:

    Anywhere on the site wherever the username of the person appears, the username has a hyperlink to their email address like a “mailto:”.

    So example on comments box:

    johnsmith would have a hyperlink mailto:johnsmith@abc.com

    But i am trying to achieve this everywhere including plugins – wherever someone’s username maybe listed

    • This topic was modified 2 years, 9 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Everything else WordPress topic
Viewing 1 replies (of 1 total)
  • You will be able to do this by writing your own filter functions into the page templates of your theme, it would have to be a child theme.

    You would use one of the string functions that take arrays of match and replace text.

    Using links as “mailto:” is unlikely to be satisfactory for many of your website visitors, most people now use webmail and so there is no “mailto:” handler registered that their browser can throw to. A more useful scheme is to link to a page on your website that fills in a contact form that would be emailed, this would also give you a chance to monitor just what the messages are being sent.

    I also doubt that it is a good idea to do this, your site could very quickly get a reputation for being spammy to its authors and participants.

Viewing 1 replies (of 1 total)
  • The topic ‘Email link to username’ is closed to new replies.