Created
October 1, 2012 15:37
-
-
Save norcross/3812557 to your computer and use it in GitHub Desktop.
Obfuscate email shortcode
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
/* | |
Usage (on the HTML tab, not the visual editor) | |
[email address="[email protected]"] | |
*/ | |
function emailbot_ssc($attr) { | |
extract( shortcode_atts( array( | |
'address' => '', | |
), $attr ) ); | |
$email = '<a class="email_link" href="mailto:'.antispambot($attr['address']).'" title="Send Us An Email" target="_blank">'; | |
$email .= antispambot($attr['address']); | |
$email .= '</a>'; | |
return $email; | |
} | |
add_shortcode('email', 'emailbot_ssc'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment