EWebwmn
Member
Posted 3 years ago #
I have a client that wants to have an email link on a post. Not on every post. Insted of using this code in the loop:
<a href="mailto:<?php echo antispambot(get_the_author_email()); ?>">email author</a>
could I use:
<a href="mailto:<?php echo antispambot(author@xyz.org); ?>">email author</a>
in the post?
Yep. Just make sure to place quotes around the address:
antispambot('author@xyz.org')
If you want to run it in a post, you'll need to use a PHP-in-post plugin like PHPExec, The Execution of All Things, CG-QuickPHP, or RunPHP.
However, if that's all you're going to do, it's probably not worth it. I just whipped up a little tool that'll run antispambot() for you.
http://code.jalenack.com/antispambot/
EWebwmn
Member
Posted 3 years ago #
Thank you jalenack!
This looks like it will work for me -just what I needed,
I am using wordpress 1.2 so I could not use the plugins wp-contactform or others I found (all for 1.5 or higher)
I really liked jalenack's solution, but it just didn't seem automated enough to me...
http://guff.szub.net/email-immunizer/
Oh, it should work with 1.2.