Created
March 13, 2012 07:07
-
-
Save Steven-Rose/2027368 to your computer and use it in GitHub Desktop.
WP: Obfuscate email addresses
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
[mailto][email protected][/mailto] | |
function mail_shortcode( $atts , $content=null ) { | |
for ($i = 0; $i < strlen($content); $i++) $encodedmail .= "&#" . ord($content[$i]) . ';'; | |
return '<a href="mailto:'.$encodedmail.'">'.$encodedmail.'</a>'; | |
} | |
add_shortcode('mailto', 'mail_shortcode'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment