Created
December 28, 2015 02:16
-
-
Save nathaningram/255602742615b34133d2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| //Anti-Spam Email Shortcode | |
| //Use this shortcode [email]info@google.com[/email] | |
| function protect_email_address( $atts , $content=null ) { | |
| for ($i = 0; $i < strlen($content); $i++) $encodedmail .= "&#" . ord($content[$i]) . ';'; | |
| return '<a href="mailto:'.$encodedmail.'">'.$encodedmail.'</a>'; | |
| } | |
| add_shortcode('email', 'protect_email_address'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment