Last active
September 29, 2016 16:44
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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