Created
June 30, 2014 13:01
-
-
Save maniaks/40fc93e64d73ca98999f to your computer and use it in GitHub Desktop.
Anti spam bot for WordPress
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
// Antispambot | |
// From http://www.guylabbe.ca/blog/wp-antispambot.html | |
function asb($content){ | |
return preg_replace('/([_a-zA-Z0-9.\-]*@[a-zA-Z0-9]([_a-zA-Z0-9\-]+\.)+[a-zA-Z]{2,10})/e',"antispambot('\\1')",$content); | |
} | |
add_filter('the_content','asb'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment