<?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, Tips, Tutorials, Plugins and Themes</description>
	<lastBuildDate>Mon, 21 May 2012 22:48:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Secure Your Mail With WordPress Antispambot Function</title>
		<link>http://wpengineer.com/849/wordpress-antispambot/</link>
		<comments>http://wpengineer.com/849/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/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 title="Kais german blog" href="http://sokai.name">Kai</a> had the cool idea to use shortcodes for this. This function belongs in the function.php of your theme folder:</p>
<pre lang="php">
&lt;?php
function wpe_secure_mail($atts) {
	extract(shortcode_atts(array(
		&quot;mailto&quot; =&gt; &#039;&#039;,
		&quot;txt&quot; =&gt; &#039;&#039;
	), $atts));
	$mailto = antispambot($mailto);
	$txt = antispambot($txt);
	return &#039;&lt;a href=&quot;mailto:&#039; . $mailto . &#039;&quot;&gt;&#039; . $txt . &#039;&lt;/a&gt;&#039;;
}

if ( function_exists(&#039;add_shortcode&#039;) )
	add_shortcode(&#039;sm&#039;, &#039;wpe_secure_mail&#039;);
?&gt;
</pre>
<p>This shortcode will be used to write in your post/page:</p>
<pre lang="php">
&#091;sm mailto=&quot;foo@bar.com&quot; txt=&quot;here is my mail&quot;&#093;
//or
&#091;sm mailto=&quot;foo@bar.com&quot; txt=&quot;foo@bar.com&quot;&#093;
</pre>
<p>Here an example, look at the source code of this page:<br />
[sm mailto="info@wpengineer.com" txt="info@wpengineer.com"]<br />
<hr /><a href="http://wpplugins.com/plugin/281/snippets" title="More informations about this plugin for WordPress"><img src="http://wpengineer.com/wp-content/themes/wpe-3/images/snippets-125-125.png" height="90" alt="WordPress Snippet Plugin" /></a> <a href="http://xtreme-theme.com"><img src="http://wpengineer.com/wp-content/uploads/feed-banner-2.jpg" alt="Xtreme One WordPress Framework"/></a><br />
&copy; <a href="http://wpengineer.com/">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://wpengineer.com/849/wordpress-antispambot/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>

