<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>WP Engineer &#187; antispambot</title> <atom:link href="http://wpengineer.com/tag/antispambot/feed/" rel="self" type="application/rss+xml" /><link>http://wpengineer.com</link> <description>WordPress News, Hacks, Tipps, Tutorials, Plugins and Themes</description> <lastBuildDate>Wed, 28 Jul 2010 13:37:05 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=2973</generator> <xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" /> <item><title>Secure Your Mail With WordPress Antispambot Function</title><link>http://wpengineer.com/wordpress-antispambot/</link> <comments>http://wpengineer.com/wordpress-antispambot/#comments</comments> <pubDate>Thu, 19 Feb 2009 22:01:23 +0000</pubDate> <dc:creator>Michael</dc:creator> <category><![CDATA[WordPress Hacks]]></category> <category><![CDATA[WordPress Tutorials]]></category> <category><![CDATA[antispambot]]></category> <category><![CDATA[hack]]></category> <category><![CDATA[Shortcode]]></category> <category><![CDATA[WordPress]]></category><guid
isPermaLink="false">http://wpengineer.com/?p=849</guid> <description><![CDATA[A little-known feature in WordPress is antispambot() from the wp-includes/formatting.php. It is a kind obfuscator of the email address. It doesn't create a clickable mailto link. Our e-mail with antispambot in the source code looks like this: You cannot use this function in a post or page unless you installed the EXEC-PHP Pluging. Kai had [...]]]></description> <content:encoded><![CDATA[<p>A little-known feature in WordPress is <strong>antispambot() </strong> from the wp-includes/formatting.php. It is a kind obfuscator of the email address. It doesn't create a clickable mailto link. Our e-mail with antispambot in the source code looks like this:<br
/> <span
id="more-849"></span><br
/> <img
class="aligncenter size-full wp-image-851" title="Screenshot WordPress antispambot email" src="http://wpengineer.com/blog/wp-content/uploads/antispambot-wordpress.jpg" alt="Screenshot WordPress antispambot email" width="450" height="94" /></p><p>You cannot use this function in a post or page unless you installed the EXEC-PHP Pluging. <a
href="http://sokai.name" title="Kais german blog" class="liexternal">Kai</a> had the cool idea to use shortcodes for this. This function belongs in the function.php of your theme folder:</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">function</span> wpe_secure_mail<span style="color: #009900;">&#40;</span><span style="color: #000088;">$atts</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #990000;">extract</span><span style="color: #009900;">&#40;</span>shortcode_atts<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
		<span style="color: #0000ff;">&quot;mailto&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">&quot;txt&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">''</span>
	<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$atts</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$mailto</span> <span style="color: #339933;">=</span> antispambot<span style="color: #009900;">&#40;</span><span style="color: #000088;">$mailto</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$txt</span> <span style="color: #339933;">=</span> antispambot<span style="color: #009900;">&#40;</span><span style="color: #000088;">$txt</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #0000ff;">'&lt;a href=&quot;mailto:'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$mailto</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;&gt;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$txt</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/a&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'add_shortcode'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
	add_shortcode<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'sm'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'wpe_secure_mail'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div><p>This shortcode will be used to write in your post/page:</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009900;">&#91;</span>sm mailto<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;foo@bar.com&quot;</span> txt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;here is my mail&quot;</span><span style="color: #009900;">&#93;</span>
<span style="color: #666666; font-style: italic;">//or</span>
<span style="color: #009900;">&#91;</span>sm mailto<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;foo@bar.com&quot;</span> txt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;foo@bar.com&quot;</span><span style="color: #009900;">&#93;</span></pre></div></div><p>Here an example, look at the source code of this page:<br
/> [sm mailto="info@wpengineer.com" txt="info@wpengineer.com"]<br
/><hr
/><p><img
style="float:left;" src="http://wpengineer.com/favicon.ico" alt="WP Engineer Favicon"/> Thanks for subscribing our feed! <a
href="http://buysellads.com/buy/detail/3646/" class="liexternal">Sponsor the WP Engineer Blog</a> and get your brand in front of several hundred users per day!<br
/> &copy; <a
href="http://wpengineer.com/" class="liinternal">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p> ]]></content:encoded> <wfw:commentRss>http://wpengineer.com/wordpress-antispambot/feed/</wfw:commentRss> <slash:comments>14</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Database Caching 23/29 queries in 0.087 seconds using disk
Object Caching 365/419 objects using disk

Served from: wpengineer.com @ 2010-07-29 13:20:21 -->