Skip to content

Instantly share code, notes, and snippets.

@ingozoell
Last active September 29, 2016 16:44
Show Gist options
  • Save ingozoell/4bd51af1a8e8b92cca597e7db3341992 to your computer and use it in GitHub Desktop.
Save ingozoell/4bd51af1a8e8b92cca597e7db3341992 to your computer and use it in GitHub Desktop.
WordPress E-Mail Spam Protection via Shortcode Hide Email from Spam Bots using a shortcode place this in your functions file
/* Shortcode spam-protected HTML "mailto"
* [email]
*
*/
function iz_email_protection($atts , $content = null ){
if ( ! is_email ($content) )
return;
return '<a href="mailto:'.antispambot($content).'">'.antispambot($content).'</a>';
}
add_shortcode( 'email','iz_email_protection');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment